mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-01 15:06:42 -05:00
add SO_REUSEPORT for freebsd 11
This commit is contained in:
parent
94ea326d89
commit
2bd5f2fe96
@ -35,6 +35,7 @@ type pfiocNatlook struct {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
sizeofPfiocNatlook = 0x4c
|
sizeofPfiocNatlook = 0x4c
|
||||||
|
soReUsePort = 0x00000200
|
||||||
soReUsePortLB = 0x00010000
|
soReUsePortLB = 0x00010000
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -192,8 +193,10 @@ func bindAddr(fd uintptr, ip []byte, port uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePortLB, 1); err != nil {
|
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePortLB, 1); err != nil {
|
||||||
|
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePort, 1); err != nil {
|
||||||
return newError("failed to set resuse_port").Base(err).AtWarning()
|
return newError("failed to set resuse_port").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var sockaddr syscall.Sockaddr
|
var sockaddr syscall.Sockaddr
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user