Merge from remote branch

This commit is contained in:
yaling888
2022-01-05 01:46:37 +08:00
15 changed files with 224 additions and 250 deletions

View File

@ -58,11 +58,11 @@ func bindIfaceToDialer(ifaceName string, dialer *net.Dialer, network string, des
return nil
}
local := int64(0)
local := uint64(0)
if dialer.LocalAddr != nil {
_, port, err := net.SplitHostPort(dialer.LocalAddr.String())
if err == nil {
local, _ = strconv.ParseInt(port, 10, 16)
local, _ = strconv.ParseUint(port, 10, 16)
}
}
@ -82,7 +82,7 @@ func bindIfaceToListenConfig(ifaceName string, _ *net.ListenConfig, network, add
port = "0"
}
local, _ := strconv.ParseInt(port, 10, 16)
local, _ := strconv.ParseUint(port, 10, 16)
addr, err := lookupLocalAddr(ifaceName, network, nil, int(local))
if err != nil {