diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-12-18 16:41:49 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-01-07 14:49:44 +0100 |
commit | 890cc06ed577420b04676d4b2d7a7daae5fb0030 (patch) | |
tree | 095d81bb691c95e8396ae4b033f9d164b1757c44 /conn | |
parent | ad73ee78e90823a92eacf7521173308a392e8323 (diff) |
conn: do not SO_REUSEADDR on linux
SO_REUSEADDR does not make sense for unicast UDP sockets.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn')
-rw-r--r-- | conn/conn_linux.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/conn/conn_linux.go b/conn/conn_linux.go index 08c8949..ef98100 100644 --- a/conn/conn_linux.go +++ b/conn/conn_linux.go @@ -328,15 +328,6 @@ func create4(port uint16) (int, uint16, error) { if err := func() error { if err := unix.SetsockoptInt( fd, - unix.SOL_SOCKET, - unix.SO_REUSEADDR, - 1, - ); err != nil { - return err - } - - if err := unix.SetsockoptInt( - fd, unix.IPPROTO_IP, unix.IP_PKTINFO, 1, @@ -379,16 +370,6 @@ func create6(port uint16) (int, uint16, error) { } if err := func() error { - - if err := unix.SetsockoptInt( - fd, - unix.SOL_SOCKET, - unix.SO_REUSEADDR, - 1, - ); err != nil { - return err - } - if err := unix.SetsockoptInt( fd, unix.IPPROTO_IPV6, |