From: bert hubert Date: Mon, 6 May 2013 19:06:31 +0000 (+0200) Subject: AddressIsUs did fail for IPv6, as Sten Spans had predicted, but failed differently ;-) X-Git-Tag: auth-3.3-rc1~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0854a6c175b805c48708d88e85a54e095fb7671;p=thirdparty%2Fpdns.git AddressIsUs did fail for IPv6, as Sten Spans had predicted, but failed differently ;-) --- diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index 5584a62ac3..a11034c3c4 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -83,7 +83,7 @@ extern StatBag S; #define GEN_IP_PKTINFO IP_RECVDSTADDR #endif -vector g_localaddresses; +vector g_localaddresses; // not static, our unit tests need to poke this void UDPNameserver::bindIPv4() { @@ -159,7 +159,7 @@ bool AddressIsUs(const ComboAddress& remote) if(remote == us) return true; if(IsAnyAddress(us)) { - int s = socket(AF_INET, SOCK_DGRAM, 0); + int s = socket(remote.sin4.sin_family, SOCK_DGRAM, 0); if(s < 0) continue;