Skip to content

Commit 756958d

Browse files
committed
conn: do not SO_REUSEADDR on linux
SO_REUSEADDR does not make sense for unicast UDP sockets. Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 85cb359 commit 756958d

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

conn/conn_linux.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,6 @@ func create4(port uint16) (int, uint16, error) {
326326
// set sockopts and bind
327327

328328
if err := func() error {
329-
if err := unix.SetsockoptInt(
330-
fd,
331-
unix.SOL_SOCKET,
332-
unix.SO_REUSEADDR,
333-
1,
334-
); err != nil {
335-
return err
336-
}
337-
338329
if err := unix.SetsockoptInt(
339330
fd,
340331
unix.IPPROTO_IP,
@@ -379,16 +370,6 @@ func create6(port uint16) (int, uint16, error) {
379370
}
380371

381372
if err := func() error {
382-
383-
if err := unix.SetsockoptInt(
384-
fd,
385-
unix.SOL_SOCKET,
386-
unix.SO_REUSEADDR,
387-
1,
388-
); err != nil {
389-
return err
390-
}
391-
392373
if err := unix.SetsockoptInt(
393374
fd,
394375
unix.IPPROTO_IPV6,

0 commit comments

Comments
 (0)