diff --git a/daemon/aux.h b/daemon/aux.h index 77abbb345..62f19c330 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -22,6 +22,17 @@ #define IPF "%u.%u.%u.%u" #define IPP(x) ((unsigned char *) (&(x)))[0], ((unsigned char *) (&(x)))[1], ((unsigned char *) (&(x)))[2], ((unsigned char *) (&(x)))[3] +#define IP6F "%x:%x:%x:%x:%x:%x:%x:%x" +#define IP6P(x) ntohs(((u_int16_t *) (x))[0]), \ + ntohs(((u_int16_t *) (x))[1]), \ + ntohs(((u_int16_t *) (x))[2]), \ + ntohs(((u_int16_t *) (x))[3]), \ + ntohs(((u_int16_t *) (x))[4]), \ + ntohs(((u_int16_t *) (x))[5]), \ + ntohs(((u_int16_t *) (x))[6]), \ + ntohs(((u_int16_t *) (x))[7]) +#define D6F IP6F ":%u" +#define D6P(x) IP6P((x).sin6_addr.s6_addr), ntohs((x).sin6_port) #define DF IPF ":%u" #define DP(x) IPP((x).sin_addr.s_addr), ntohs((x).sin_port) diff --git a/daemon/call.c b/daemon/call.c index 81497abc8..bdcf9633d 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -119,7 +119,7 @@ static void kernelize(struct callstream *c) { r = &p->rtps[j]; rp = &pp->rtps[j]; - if (!r->fd_family || !r->peer.port) + if (IN6_IS_ADDR_UNSPECIFIED(&r->peer.ip46) || !r->fd_family || !r->peer.port) continue; ks.local_port = r->localport; @@ -1122,7 +1122,7 @@ static char *streams_print(GQueue *s, unsigned int num, unsigned int off, const else if (t->call->callmaster->adv_ipv4) sprintf(ips, IPF, IPP(t->call->callmaster->adv_ipv4)); else - sprintf(ips, IPF, IPP(ip4)); + sprintf(ips, IPF, IPP(t->call->callmaster->ipv4)); } else { if (IN6_IS_ADDR_UNSPECIFIED(&t->peers[off].rtps[0].peer.ip46)) @@ -1130,11 +1130,9 @@ static char *streams_print(GQueue *s, unsigned int num, unsigned int off, const else if (!IN6_IS_ADDR_UNSPECIFIED(&t->call->callmaster->adv_ipv6)) inet_ntop(AF_INET6, &t->call->callmaster->adv_ipv6, ips, sizeof(ips)); else - inet_ntop(AF_INET6, &t->peers[off].rtps[0].peer.ip46, ips, sizeof(ips)); + inet_ntop(AF_INET6, &t->call->callmaster->ipv6, ips, sizeof(ips)); } - t = s->head->data; - if (!swap) g_string_append(o, ips);