mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
In golang/go#37319, TestPacketConnReadWriteMulticastUDP was observed to occasionally fail with ENOBUFS on macOS. This change adds a retry loop for that test function. There are some other related test functions that may also wrap sendmsg, but I have not observed any ENOBUFS failures for them — I suspect that some difference in protocol or traffic class prevents this failure mode, but we can always add more retry loops if we discover that they are actually needed. Fixes golang/go#37319. Change-Id: I99fce94ff10c6f3c09d493712eba782ec8707a58 Reviewed-on: https://go-review.googlesource.com/c/net/+/369742 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
21 lines
549 B
Go
21 lines
549 B
Go
// Copyright 2021 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
|
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package ipv6_test
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// isENOBUFS reports whether err is unix.ENOBUFS.
|
|
// (Always false on non-Unix platforms.)
|
|
func isENOBUFS(err error) bool {
|
|
return errors.Is(err, unix.ENOBUFS)
|
|
}
|