when building with debugging enabled, but without ipv6 support,
ngircd dumped core when loading a config file that specified an ipv6
listen address.
ngircd: ng_ipaddr.c:45: ng_ipaddr_init: Assertion `sizeof(*addr) >=
res0->ai_addrlen' failed.
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
+#ifndef WANT_IPV6 /* do not convert ipv6 addresses */
+ hints.ai_family = AF_INET;
+#endif
/* some getaddrinfo implementations require that ai_socktype is set. */
hints.ai_socktype = SOCK_STREAM;
snprintf(portstr, sizeof(portstr), "%u", (unsigned int) port);
ret = getaddrinfo(ip_str, portstr, &hints, &res0);
- assert(ret == 0);
if (ret != 0)
return false;