This can happen if you get an IPv6 address for the -a argument, but
runs without IPv6 enabled in your kernel. Typically happens only
for localhost.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1559
d4fa192b-c00b-0410-8231-
f00ffab90ce4
static int
open_sockets(void)
{
- struct listen_sock *ls;
+ struct listen_sock *ls, *ls2;
+ int good = 0;
- TAILQ_FOREACH(ls, &heritage.socks, list) {
+ TAILQ_FOREACH_SAFE(ls, &heritage.socks, list, ls2) {
if (ls->sock >= 0)
continue;
ls->sock = VSS_listen(ls->addr, params->listen_depth);
+ if (ls->sock < 0) {
+ TAILQ_REMOVE(&heritage.socks, ls, list);
+ free(ls);
+ continue;
+ }
TCP_filter_http(ls->sock);
- if (ls->sock < 0)
- return (1);
+ good++;
}
+ if (!good)
+ return (1);
return (0);
}