]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
AddressIsUs did fail for IPv6, as Sten Spans had predicted, but failed differently ;-)
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 6 May 2013 19:06:31 +0000 (21:06 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 6 May 2013 19:06:31 +0000 (21:06 +0200)
pdns/nameserver.cc

index 5584a62ac31a09ab1d693ac0b10d580a158e47d8..a11034c3c41e62a732ea1be6ac059195c09a47fc 100644 (file)
@@ -83,7 +83,7 @@ extern StatBag S;
   #define GEN_IP_PKTINFO IP_RECVDSTADDR 
 #endif
 
-vector<ComboAddress> g_localaddresses;
+vector<ComboAddress> 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;