Browse Source

fix mixup of reported local address

pull/163/head
Richard Fuchs 11 years ago
parent
commit
ee6d029fd5
3 changed files with 9 additions and 5 deletions
  1. +6
    -5
      daemon/call.c
  2. +2
    -0
      daemon/socket.c
  3. +1
    -0
      daemon/socket.h

+ 6
- 5
daemon/call.c View File

@ -1968,17 +1968,18 @@ int call_stream_address46(char *o, struct packet_stream *ps, enum stream_address
int l = 0;
const struct intf_address *ifa_addr;
sink = packet_stream_sink(ps);
if (!ifa)
ifa = sink->selected_sfd->local_intf;
ifa = ps->selected_sfd->local_intf;
ifa_addr = &ifa->spec->address;
sink = packet_stream_sink(ps);
if (format == SAF_NG)
l += sprintf(o + l, "%s ", ifa_addr->addr.family->rfc_name);
if (is_addr_unspecified(&ps->advertised_endpoint.address)
&& !is_trickle_ice_address(&ps->advertised_endpoint))
l += sprintf(o + l, "%s", sockaddr_print_buf(&ps->advertised_endpoint.address));
if (is_addr_unspecified(&sink->advertised_endpoint.address)
&& !is_trickle_ice_address(&sink->advertised_endpoint))
l += sprintf(o + l, "%s", ifa_addr->addr.family->unspec_string);
else
l += sprintf(o + l, "%s", sockaddr_print_buf(&ifa_addr->advertised));


+ 2
- 0
daemon/socket.c View File

@ -45,6 +45,7 @@ static struct socket_family __socket_families[__SF_LAST] = {
.sockaddr_size = sizeof(struct sockaddr_in),
.name = "IPv4",
.rfc_name = "IP4",
.unspec_string = "0.0.0.0",
.hash = __ip4_hash,
.eq = __ip4_eq,
.addr_parse = __ip4_addr_parse,
@ -66,6 +67,7 @@ static struct socket_family __socket_families[__SF_LAST] = {
.sockaddr_size = sizeof(struct sockaddr_in6),
.name = "IPv6",
.rfc_name = "IP6",
.unspec_string = "::",
.hash = __ip6_hash,
.eq = __ip6_eq,
.addr_parse = __ip6_addr_parse,


+ 1
- 0
daemon/socket.h View File

@ -46,6 +46,7 @@ struct socket_family {
size_t sockaddr_size;
const char *name; /* "IPv4" */
const char *rfc_name; /* "IP4" */
const char *unspec_string; /* 0.0.0.0 or :: */
unsigned int (*hash)(const sockaddr_t *);
int (*eq)(const sockaddr_t *, const sockaddr_t *);
int (*addr_parse)(sockaddr_t *, const char *);


Loading…
Cancel
Save