Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

nfqws2: fix non-working dns ipcache if --debug=0

This commit is contained in:
bol-van
2026-01-02 20:01:23 +03:00
parent 5b58997e3e
commit 7278bb1b87

View File

@@ -1543,23 +1543,17 @@ static bool feed_dns_response(const uint8_t *a, size_t len)
{
case 1: // A
if (dlen!=4) break;
if (params.debug)
{
if (inet_ntop(AF_INET, a+12, s_ip, sizeof(s_ip)))
DLOG("DNS response for '%s' : %s\n", name, s_ip);
if (ipcache_put_hostname((struct in_addr *)(a+12), NULL, name, false))
DLOG("ipcache updated\n");
}
if (params.debug && inet_ntop(AF_INET, a+12, s_ip, sizeof(s_ip)))
DLOG("DNS response for '%s' : %s\n", name, s_ip);
if (ipcache_put_hostname((struct in_addr *)(a+12), NULL, name, false))
DLOG("ipcache updated\n");
break;
case 28: // AAAA
if (dlen!=16) break;
if (params.debug)
{
if (inet_ntop(AF_INET6, a+12, s_ip, sizeof(s_ip)))
DLOG("DNS response for '%s' : %s\n", name, s_ip);
if (ipcache_put_hostname(NULL, (struct in6_addr *)(a+12), name, false))
DLOG("ipcache updated\n");
}
if (params.debug && inet_ntop(AF_INET6, a+12, s_ip, sizeof(s_ip)))
DLOG("DNS response for '%s' : %s\n", name, s_ip);
if (ipcache_put_hostname(NULL, (struct in6_addr *)(a+12), name, false))
DLOG("ipcache updated\n");
break;
}
}