@@ -13,9 +13,6 @@ const (
1313 TCP_FASTOPEN = 15
1414 IP_UNICAST_IF = 31
1515 IPV6_UNICAST_IF = 31
16- IP_MULTICAST_IF = 9
17- IPV6_MULTICAST_IF = 9
18- IPV6_V6ONLY = 27
1916)
2017
2118func setTFO (fd syscall.Handle , tfo int ) error {
@@ -44,14 +41,14 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
4441 if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IP , IP_UNICAST_IF , int (idx )); err != nil {
4542 return errors .New ("failed to set IP_UNICAST_IF" ).Base (err )
4643 }
47- if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IP , IP_MULTICAST_IF , int (idx )); err != nil {
44+ if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IP , syscall . IP_MULTICAST_IF , int (idx )); err != nil {
4845 return errors .New ("failed to set IP_MULTICAST_IF" ).Base (err )
4946 }
5047 } else {
5148 if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , IPV6_UNICAST_IF , inf .Index ); err != nil {
5249 return errors .New ("failed to set IPV6_UNICAST_IF" ).Base (err )
5350 }
54- if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , IPV6_MULTICAST_IF , inf .Index ); err != nil {
51+ if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , syscall . IPV6_MULTICAST_IF , inf .Index ); err != nil {
5552 return errors .New ("failed to set IPV6_MULTICAST_IF" ).Base (err )
5653 }
5754 }
@@ -92,7 +89,7 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
9289 }
9390
9491 if config .V6Only {
95- if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , IPV6_V6ONLY , 1 ); err != nil {
92+ if err := syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , syscall . IPV6_V6ONLY , 1 ); err != nil {
9693 return errors .New ("failed to set IPV6_V6ONLY" ).Base (err )
9794 }
9895 }
0 commit comments