hotfix(pmtud/tcp): fix code for IPv6 destinations

This commit is contained in:
Quentin McGaw
2026-02-20 16:23:40 +00:00
parent 73b3e2c88a
commit c66d8bed00
8 changed files with 21 additions and 39 deletions
+4 -6
View File
@@ -47,12 +47,10 @@ func startRawSocket(family, excludeMark int) (fd fileDescriptor, stop func(), er
if family == constants.AF_INET {
err = ip.SetIPv4HeaderIncluded(fdPlatform)
} else {
err = ip.SetIPv6HeaderIncluded(fdPlatform)
}
if err != nil {
_ = closeSocket(fdPlatform)
return 0, nil, fmt.Errorf("setting header option on raw socket: %w", err)
if err != nil {
_ = closeSocket(fdPlatform)
return 0, nil, fmt.Errorf("setting header option on raw socket: %w", err)
}
}
// Allow sending packets larger than cached PMTU (for PMTUD probing)