From 98109ea92e5e27300d190fc4bf389816123eddbd Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 6 May 2014 15:15:07 +0200 Subject: [PATCH] miniupnpd/getifaddr.c: fix when IPV6 is not enabled --- miniupnpd/getifaddr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miniupnpd/getifaddr.c b/miniupnpd/getifaddr.c index 361c89b..06bdbca 100644 --- a/miniupnpd/getifaddr.c +++ b/miniupnpd/getifaddr.c @@ -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 */