From e677018004a41a1895a44fca88a6ff2323093064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 10 Jan 2014 00:21:07 +0200 Subject: [PATCH] Allow binding to a listen address that doesn't exist yet --- src/daemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/daemon.c b/src/daemon.c index 3e211f2..ee836e5 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -98,6 +98,9 @@ void daemon_open_sockets(void) /* Allow local port reuse in TIME_WAIT */ setsockopt(sks_serv[sks_serv_num], SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + /* Allow binding to a listen address that doesn't exist yet */ + setsockopt(sks_serv[sks_serv_num], SOL_IP, IP_FREEBIND, &on, sizeof(on)); + /* Now we've got a socket - we need to bind it. */ if (bind(sks_serv[sks_serv_num], resp->ai_addr, resp->ai_addrlen) < 0) { /* Nope, try another */ -- 1.8.3.1