Skip to content

Commit

Permalink
call udp_tune() before bind()
Browse files Browse the repository at this point in the history
This is because if you want SO_REUSEPORT you need the sockopt set first.
  • Loading branch information
pysiak committed Oct 10, 2014
1 parent 8e31542 commit a9e2157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions udp_request.c
Expand Up @@ -468,6 +468,8 @@ udp_listener_bind(struct context *c)
return -1; return -1;
} }


udp_tune(c->udp_listener_handle);

evutil_make_socket_closeonexec(c->udp_listener_handle); evutil_make_socket_closeonexec(c->udp_listener_handle);
evutil_make_socket_nonblocking(c->udp_listener_handle); evutil_make_socket_nonblocking(c->udp_listener_handle);
if (bind if (bind
Expand All @@ -481,8 +483,6 @@ udp_listener_bind(struct context *c)
return -1; return -1;
} }


udp_tune(c->udp_listener_handle);

// resolver socket // resolver socket
assert(c->udp_resolver_handle == -1); assert(c->udp_resolver_handle == -1);
if ((c->udp_resolver_handle = if ((c->udp_resolver_handle =
Expand Down

0 comments on commit a9e2157

Please sign in to comment.