Include an index number (starting at 0) and the line number (but not
filename) at which we were defined. This is allows the user to more
easily see (for example) which comm_addrs actually belong to the same
udp, even if they might have a different ix and thus be reported with
different local addresses.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
struct udpcommon uc;
struct udpsocks socks;
bool_t addr_configured;
struct udpcommon uc;
struct udpsocks socks;
bool_t addr_configured;
int ix=ca->ix>=0 ? ca->ix : 0;
assert(ix>=0 && ix<socks->n_socks);
int ix=ca->ix>=0 ? ca->ix : 0;
assert(ix>=0 && ix<socks->n_socks);
- snprintf(sbuf, sizeof(sbuf), "udp:%s%s-%s",
+ snprintf(sbuf, sizeof(sbuf), "udp#%u@l%d:%s%s-%s",
+ st->counter, st->uc.cc.loc.line,
iaddr_to_string(&socks->socks[ix].addr),
ca->ix<0 && socks->n_socks>1 ? "&" : "",
iaddr_to_string(&ca->ia));
iaddr_to_string(&socks->socks[ix].addr),
ca->ix<0 && socks->n_socks>1 ? "&" : "",
iaddr_to_string(&ca->ia));
static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,
list_t *args)
{
static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,
list_t *args)
{
+ static unsigned counter;
+
struct udp *st;
list_t *caddrl;
list_t *l;
struct udp *st;
list_t *caddrl;
list_t *l;
struct udpsocks *socks=&st->socks;
struct commcommon *cc=&uc->cc;
struct udpsocks *socks=&st->socks;
struct commcommon *cc=&uc->cc;
+ st->counter=counter++;
+
union iaddr defaultaddrs[] = {
#ifdef CONFIG_IPV6
{ .sin6 = { .sin6_family=AF_INET6,
union iaddr defaultaddrs[] = {
#ifdef CONFIG_IPV6
{ .sin6 = { .sin6_family=AF_INET6,