diff options
| author | Florian Westphal <fw@strlen.de> | 2009-09-26 11:12:47 +0200 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2009-09-26 11:12:47 +0200 |
| commit | fa09883c72855768a0f827a330097bf3dc5c839e (patch) | |
| tree | 17b02afd26f70842662cb4507e882dac9ee0ea02 /src | |
| parent | affa03b277bb479c050f2d6967ae410e49e0d2ac (diff) | |
| download | ngircd-fa09883c72855768a0f827a330097bf3dc5c839e.tar.gz ngircd-fa09883c72855768a0f827a330097bf3dc5c839e.zip | |
fix assertion failure in ng_ipaddr.c
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ipaddr/ng_ipaddr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ipaddr/ng_ipaddr.c b/src/ipaddr/ng_ipaddr.c index 4f1d4ca4..af524d09 100644 --- a/src/ipaddr/ng_ipaddr.c +++ b/src/ipaddr/ng_ipaddr.c @@ -30,6 +30,9 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) 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; @@ -38,7 +41,6 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) snprintf(portstr, sizeof(portstr), "%u", (unsigned int) port); ret = getaddrinfo(ip_str, portstr, &hints, &res0); - assert(ret == 0); if (ret != 0) return false; |