Skip to content

Commit

Permalink
only set DF for sockets that can handle it (#3448)
Browse files Browse the repository at this point in the history
Fixes #3445
  • Loading branch information
nmldiegues committed Jun 19, 2022
1 parent 6fbc6d9 commit 706a482
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sys_conn.go
Expand Up @@ -30,9 +30,13 @@ func wrapConn(pc net.PacketConn) (rawConn, error) {
if err != nil {
return nil, err
}
err = setDF(rawConn)
if err != nil {
return nil, err

if _, ok := pc.LocalAddr().(*net.UDPAddr); ok {
// Only set DF on sockets that we expect to be able to handle that configuration.
err = setDF(rawConn)
if err != nil {
return nil, err
}
}
}
c, ok := pc.(OOBCapablePacketConn)
Expand Down

0 comments on commit 706a482

Please sign in to comment.