| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | //go:build (openbsd || freebsd) && !e2e_testing// +build openbsd freebsd// +build !e2e_testingpackage udp// FreeBSD support is primarily implemented in udp_generic, besides NewListenConfigimport (	"fmt"	"net"	"net/netip"	"syscall"	"github.com/sirupsen/logrus"	"golang.org/x/sys/unix")func NewListener(l *logrus.Logger, ip netip.Addr, port int, multi bool, batch int) (Conn, error) {	return NewGenericListener(l, ip, port, multi, batch)}func NewListenConfig(multi bool) net.ListenConfig {	return net.ListenConfig{		Control: func(network, address string, c syscall.RawConn) error {			if multi {				var controlErr error				err := c.Control(func(fd uintptr) {					if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {						controlErr = fmt.Errorf("SO_REUSEPORT failed: %v", err)						return					}				})				if err != nil {					return err				}				if controlErr != nil {					return controlErr				}			}			return nil		},	}}func (u *GenericConn) Rebind() error {	return nil}
 |