forked from quic-go/quic-go
catch EPERM sendmsg errors for the very first packet on Linux (#4111)
This commit is contained in:
@@ -97,3 +97,14 @@ func isGSOError(err error) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// The first sendmsg call on a new UDP socket sometimes errors on Linux.
|
||||
// It's not clear why this happens.
|
||||
// See https://github.com/golang/go/issues/63322.
|
||||
func isPermissionError(err error) bool {
|
||||
var serr *os.SyscallError
|
||||
if errors.As(err, &serr) {
|
||||
return serr.Syscall == "sendmsg" && serr.Err == unix.EPERM
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user