From a9e2157ccf73e9da46f2442ffe6d1e94dd88d01c Mon Sep 17 00:00:00 2001 From: Maciej Soltysiak Date: Fri, 10 Oct 2014 21:51:02 +0200 Subject: [PATCH] call udp_tune() before bind() This is because if you want SO_REUSEPORT you need the sockopt set first. --- udp_request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udp_request.c b/udp_request.c index 5595fdc..d7a08f0 100644 --- a/udp_request.c +++ b/udp_request.c @@ -468,6 +468,8 @@ udp_listener_bind(struct context *c) return -1; } + udp_tune(c->udp_listener_handle); + evutil_make_socket_closeonexec(c->udp_listener_handle); evutil_make_socket_nonblocking(c->udp_listener_handle); if (bind @@ -481,8 +483,6 @@ udp_listener_bind(struct context *c) return -1; } - udp_tune(c->udp_listener_handle); - // resolver socket assert(c->udp_resolver_handle == -1); if ((c->udp_resolver_handle =