Do reverse lookups using the AF of the incoming connection

This fixes errors like this one:
  Address mismatch: 2001🔢abcd:1::1 != 192.168.1.1
This commit is contained in:
Alexander Barton 2011-04-26 11:09:59 +02:00
parent e4e1595bff
commit 160f5725a6
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ Do_ResolveAddr(const ng_ipaddr_t *Addr, int identsock, int w_fd)
if (!ReverseLookup(Addr, hostname, sizeof(hostname))) if (!ReverseLookup(Addr, hostname, sizeof(hostname)))
goto dns_done; 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)) { if (!Addr_in_list(&resolved_addr, Addr)) {
Log_Forgery_WrongIP(tmp_ip_str, hostname); Log_Forgery_WrongIP(tmp_ip_str, hostname);
strlcpy(hostname, tmp_ip_str, sizeof(hostname)); strlcpy(hostname, tmp_ip_str, sizeof(hostname));