From: Petr Špaček Date: Tue, 8 Oct 2019 16:57:07 +0000 (+0200) Subject: http: fix SO_REUSEPORT for HTTP sockets X-Git-Tag: v4.3.0~23^2~2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fenvironments%2Fobs-knot-resolver-bs4hbr%2Fdeployments%2F286;p=thirdparty%2Fknot-resolver.git http: fix SO_REUSEPORT for HTTP sockets lua-cqueues.socket.fdopen() resets the reuseport flag, so binding Nth instance without systemd socket activation failed --- diff --git a/modules/http/http.lua.in b/modules/http/http.lua.in index 0d07c4e66..4e6967cd8 100644 --- a/modules/http/http.lua.in +++ b/modules/http/http.lua.in @@ -278,7 +278,7 @@ local function add_socket(fd, kind, addr_str) assert(M.servers[fd] == nil, 'socket is already served by an HTTP instance') local conf = mergeconf(M.configs._builtin._all, M.configs._builtin[kind], M.configs._all, M.configs[kind]) - conf.socket = cqueues.socket.fdopen(fd) + conf.socket = cqueues.socket.fdopen({ fd = fd, reuseport = true, reuseaddr = true }) if conf.tls ~= false then -- Create a TLS context, either from files or new. if conf.ephemeral then if not M.ephem_state then