From: Alexander Barton Date: Tue, 26 Apr 2011 09:09:59 +0000 (+0200) Subject: Do reverse lookups using the AF of the incoming connection X-Git-Tag: rel-18-rc1~18^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=160f5725a6646d432f70fe8b677ffdbcbdeb02ce;p=ngircd Do reverse lookups using the AF of the incoming connection This fixes errors like this one: Address mismatch: 2001:1234:abcd:1::1 != 192.168.1.1 --- diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index ff40b8d5..9b17af9c 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -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));