sticky-sockets: do not use SO_REUSEADDR

This makes little sense for unicast UDP sockets.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-12-18 23:40:15 +01:00
parent 7e506135f7
commit 66ed611bd0

View file

@ -195,10 +195,6 @@ int magic_create_sock4(uint16_t listen_port)
if (fd < 0)
return fd;
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
if (ret < 0)
goto err;
ret = setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
if (ret < 0)
goto err;
@ -228,10 +224,6 @@ int magic_create_sock6(uint16_t listen_port)
if (fd < 0)
return fd;
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
if (ret < 0)
goto err;
ret = setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
if (ret < 0)
goto err;