check for WSAEMSGSIZE errors when receiving UDP packets on Windows (#3982)

* check for WSAEMSGSIZE errors when receiving UDP packets on Windows

* check EMSGSIZE error on macOS
This commit is contained in:
Marten Seemann
2023-07-20 20:31:57 -07:00
committed by GitHub
parent 2183283622
commit 2bcfe5bc4b
6 changed files with 23 additions and 5 deletions

View File

@@ -47,10 +47,12 @@ func setDF(rawConn syscall.RawConn) (bool, error) {
return true, nil
}
func isMsgSizeErr(err error) bool {
func isSendMsgSizeErr(err error) bool {
return errors.Is(err, unix.EMSGSIZE)
}
func isRecvMsgSizeErr(error) bool { return false }
func isAtLeastMacOS11() (bool, error) {
uname := &unix.Utsname{}
err := unix.Uname(uname)