From 0344410cddad7cfa627f75f0559004be45f7fea4 Mon Sep 17 00:00:00 2001 From: Michael Gernoth <michael@gernoth.net> Date: Tue, 28 Apr 2020 11:19:45 +0200 Subject: [PATCH] Fix "protocol not available" for IPv6 connections --- utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.go b/utils.go index 5706560..2610bb7 100644 --- a/utils.go +++ b/utils.go @@ -69,7 +69,7 @@ func DialUpstreamControl(sport int) func(string, string, syscall.RawConn) error } if network == "tcp6" || network == "udp6" { - syscallErr = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_IP, syscall.IPV6_V6ONLY, 0) + syscallErr = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, 0) if syscallErr != nil { syscallErr = fmt.Errorf("setsockopt(IPPROTO_IP, IPV6_ONLY, 0): %s", syscallErr.Error()) return -- GitLab