mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-05 23:03:34 +03:00
parent
52a2c63682
commit
5842bbc9f7
1 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,7 @@ const (
|
|||
IPV6_UNICAST_IF = 31
|
||||
IP_MULTICAST_IF = 9
|
||||
IPV6_MULTICAST_IF = 9
|
||||
IPV6_V6ONLY = 27
|
||||
)
|
||||
|
||||
func setTFO(fd syscall.Handle, tfo int) error {
|
||||
|
@ -89,6 +90,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
|||
}
|
||||
}
|
||||
}
|
||||
if config.V6Only {
|
||||
if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_IPV6, IPV6_V6ONLY, 1); err != nil {
|
||||
return errors.New("failed to set IPV6_V6ONLY").Base(err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue