1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

fix bind address in linux

This commit is contained in:
Darien Raymond 2018-09-30 19:37:08 +02:00
parent d55fbd7f8d
commit 07aa486d43
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -14,6 +14,11 @@ const (
)
func bindAddr(fd uintptr, address net.Address, port net.Port) error {
err = syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
if err != nil {
return newError("failed to set resuse_addr").Base(err).AtWarning()
}
var sockaddr syscall.Sockaddr
switch address.Family() {