Skip to content
Snippets Groups Projects
Commit 4847e1ba authored by Marek Vavruša's avatar Marek Vavruša Committed by Jan Kadlec
Browse files

Fix in SO_REUSEPORT usage.


Signed-off-by: default avatarJan Kadlec <jan.kadlec@nic.cz>
parent f4de5482
No related branches found
No related tags found
No related merge requests found
......@@ -118,12 +118,16 @@ static int server_init_iface(iface_t *new_if, conf_iface_t *cfg_if)
char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(&cfg_if->addr, addr_str, sizeof(addr_str));
#if defined(SO_REUSEPORT)
/* Each thread binds own socket. */
int sock = -1;
#else
/* Create bound UDP socket. */
int sock = net_bound_socket(SOCK_DGRAM, &cfg_if->addr);
if (sock < 0) {
return sock;
}
#endif
new_if->fd[IO_UDP] = sock;
/* Create bound TCP socket. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment