From: Tomek Mrugalski Date: Thu, 22 Dec 2011 16:44:55 +0000 (+0100) Subject: [1526] NetBSD compilation fix for perfdhcp. X-Git-Tag: trac2351_base~299^2~14^2^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=102355de8ca47e80fcf3bc2a884f36907b7b7922;p=thirdparty%2Fkea.git [1526] NetBSD compilation fix for perfdhcp. --- diff --git a/tests/tools/perfdhcp/perfdhcp.c b/tests/tools/perfdhcp/perfdhcp.c index b9795f6d68..3e38e2d51c 100644 --- a/tests/tools/perfdhcp/perfdhcp.c +++ b/tests/tools/perfdhcp/perfdhcp.c @@ -1918,7 +1918,13 @@ getserveraddr(const int flags) service = "547"; } hints.ai_socktype = SOCK_DGRAM; - hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV | flags; + + hints.ai_flags = AI_NUMERICSERV | flags; +#if defined(OS_LINUX) + /// TODO: Make this OS_LINUX | OS_MAC as this works on Mac + /// and possibly other BSDs. + hints.ai_flags |= AI_ADDRCONFIG; +#endif hints.ai_protocol = IPPROTO_UDP; ret = getaddrinfo(servername, service, &hints, &res); @@ -2015,7 +2021,11 @@ getlocaladdr(void) service = "546"; } hints.ai_socktype = SOCK_DGRAM; - hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; + hints.ai_flags = AI_NUMERICSERV; +#if defined(OS_LINUX) + // TODO: this will work on Mac as well (so it should be OS_LINUX | OS_MAC) + hints.ai_flags |= AI_ADDRCONFIG; +#endif hints.ai_protocol = IPPROTO_UDP; ret = getaddrinfo(localname, service, &hints, &res);