Skip to content

Commit 5b7cb52

Browse files
committed
Make ip-utils aware of 0.0.0.0 and :: (see #3470)
1 parent 61a4d2c commit 5b7cb52

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ip-utils.c

+9
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,15 @@ int janus_network_lookup_interface(const struct ifaddrs *ifas, const char *iface
242242
if(ifas == NULL || iface == NULL || result == NULL)
243243
return -EINVAL;
244244
janus_network_address_nullify(result);
245+
if(!strcmp(iface, "0.0.0.0")) {
246+
result->family = AF_INET;
247+
result->ipv4.s_addr = INADDR_ANY;
248+
return 0;
249+
} else if(!strcmp(iface, "::")) {
250+
result->family = AF_INET6;
251+
result->ipv6 = in6addr_any;
252+
return 0;
253+
}
245254
janus_network_query_config q;
246255
/* Let's see if iface is an IPv4 address, an IPv6 address, or possibly an interface name */
247256
int res = janus_network_prepare_device_query(iface,

0 commit comments

Comments
 (0)