mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 23:06:30 -05:00
fix bind address in linux
This commit is contained in:
parent
d55fbd7f8d
commit
07aa486d43
@ -14,6 +14,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func bindAddr(fd uintptr, address net.Address, port net.Port) error {
|
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
|
var sockaddr syscall.Sockaddr
|
||||||
|
|
||||||
switch address.Family() {
|
switch address.Family() {
|
||||||
|
Loading…
Reference in New Issue
Block a user