Commit a40a65f0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Discard any listen sockets that fail to bind().

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: http://www.varnish-cache.org/svn/trunk/varnish-cache@1559 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8b292128
......@@ -126,16 +126,23 @@ child_poker(struct ev *e, int what)
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment