]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Do reverse lookups using the AF of the incoming connection
authorAlexander Barton <alex@barton.de>
Tue, 26 Apr 2011 09:09:59 +0000 (11:09 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 26 Apr 2011 09:10:50 +0000 (11:10 +0200)
This fixes errors like this one:
  Address mismatch: 2001:1234:abcd:1::1 != 192.168.1.1

src/ngircd/resolve.c

index ff40b8d523cd10853e69353d283abeabcb86d2d9..9b17af9cb202209b4b5e79c53c50d316a2df3105 100644 (file)
@@ -380,7 +380,7 @@ Do_ResolveAddr(const ng_ipaddr_t *Addr, int identsock, int w_fd)
        if (!ReverseLookup(Addr, hostname, sizeof(hostname)))
                goto dns_done;
 
-       if (ForwardLookup(hostname, &resolved_addr, AF_UNSPEC)) {
+       if (ForwardLookup(hostname, &resolved_addr, ng_ipaddr_af(Addr))) {
                if (!Addr_in_list(&resolved_addr, Addr)) {
                        Log_Forgery_WrongIP(tmp_ip_str, hostname);
                        strlcpy(hostname, tmp_ip_str, sizeof(hostname));