From 4e11d81d67b93a37a8638faf7a20ef4fcd25ff4f Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 16 Nov 2024 13:13:02 +0100 Subject: [PATCH] Fix IPv6 hosts not resolving in UnrealIRCd 6.1.8 / 6.1.8.1. Reported by bss on IRC. Changed: r->ipv6 = IsIPV6(client); To: r->ipv6 = IsIPV6(client) ? 1 : 0; The problem is that: #define IsIPV6(x) ((x)->flags & CLIENT_FLAG_IPV6) (..so without ?1:0..) made this effectively: r->ipv6 = CLIENT_FLAG_IPV6; ..which is.. #define CLIENT_FLAG_IPV6 0x800000000 /**< client is using IPv6 */ .. and 0x800000000 doesn't fit in r->ipv6, which is of size 'char' (so max is 0xff) --- src/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns.c b/src/dns.c index d547cf906..1f28174af 100644 --- a/src/dns.c +++ b/src/dns.c @@ -309,7 +309,7 @@ struct hostent *unrealdns_doclient(Client *client) /* Create a request */ r = safe_alloc(sizeof(DNSReq)); r->client = client; - r->ipv6 = IsIPV6(client); + r->ipv6 = IsIPV6(client) ? 1 : 0; unrealdns_addreqtolist(r); /* Execute it */