1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 07:53:13 +02:00

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)
This commit is contained in:
Bram Matthys
2024-11-16 13:13:02 +01:00
parent 18b171a071
commit 4e11d81d67
+1 -1
View File
@@ -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 */