mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
fix bind addr check
This commit is contained in:
parent
ef739c2127
commit
ee13f7a562
@ -40,7 +40,7 @@ func resolveSrcAddr(network net.Network, src net.Address) net.Addr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func hasBindAddr(sockopt *SocketConfig) bool {
|
func hasBindAddr(sockopt *SocketConfig) bool {
|
||||||
return len(sockopt.BindAddress) > 0 && sockopt.BindPort > 0
|
return sockopt != nil && len(sockopt.BindAddress) > 0 && sockopt.BindPort > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, sockopt *SocketConfig) (net.Conn, error) {
|
func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, sockopt *SocketConfig) (net.Conn, error) {
|
||||||
@ -67,7 +67,7 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
|
|||||||
}
|
}
|
||||||
|
|
||||||
dialer := &net.Dialer{
|
dialer := &net.Dialer{
|
||||||
Timeout: time.Second * 60,
|
Timeout: time.Second * 16,
|
||||||
DualStack: true,
|
DualStack: true,
|
||||||
LocalAddr: resolveSrcAddr(dest.Network, src),
|
LocalAddr: resolveSrcAddr(dest.Network, src),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user