mirror of https://github.com/v2ray/v2ray-core
fix udp not work in ipv4 using common config
parent
333d20d7d9
commit
2c50e56904
|
@ -100,10 +100,10 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.ReceiveOriginalDestAddress && isUDPSocket(network) {
|
if config.ReceiveOriginalDestAddress && isUDPSocket(network) {
|
||||||
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_IPV6, unix.IPV6_RECVORIGDSTADDR, 1); err != nil {
|
err1 := syscall.SetsockoptInt(int(fd), syscall.SOL_IPV6, unix.IPV6_RECVORIGDSTADDR, 1)
|
||||||
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_IP, syscall.IP_RECVORIGDSTADDR, 1); err != nil {
|
err2 := syscall.SetsockoptInt(int(fd), syscall.SOL_IP, syscall.IP_RECVORIGDSTADDR, 1)
|
||||||
return err
|
if err1 != nil && err2 != nil {
|
||||||
}
|
return err1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue