miniupnpd/getifaddr.c: fix when IPV6 is not enabled
This commit is contained in:
parent
338a533a09
commit
98109ea92e
|
@ -198,6 +198,8 @@ int getifaddr_in6(const char * ifname, int af, struct in6_addr * addr)
|
|||
#else /* defined(ENABLE_IPV6) || defined(USE_GETIFADDRS) */
|
||||
/* IPv4 only */
|
||||
struct in_addr addr4;
|
||||
if(af != AF_INET)
|
||||
return -1;
|
||||
if(getifaddr(ifname, NULL, 0, &addr4, NULL) < 0)
|
||||
return -1;
|
||||
/* IPv4-mapped IPv6 address ::ffff:1.2.3.4 */
|
||||
|
|
Loading…
Reference in New Issue