Module: ngircd.git Branch: master Commit: 160f5725a6646d432f70fe8b677ffdbcbdeb02ce URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=160f5...
Author: Alexander Barton alex@barton.de Date: Tue Apr 26 11:09:59 2011 +0200
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
---
src/ngircd/resolve.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index ff40b8d..9b17af9 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));