summaryrefslogtreecommitdiffhomepage
path: root/net/udprelay/server_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'net/udprelay/server_linux.go')
-rw-r--r--net/udprelay/server_linux.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/udprelay/server_linux.go b/net/udprelay/server_linux.go
index d4cf2a2b1..106efb071 100644
--- a/net/udprelay/server_linux.go
+++ b/net/udprelay/server_linux.go
@@ -6,10 +6,10 @@
package udprelay
import (
- "net"
"syscall"
"golang.org/x/sys/unix"
+ "tailscale.com/types/nettype"
)
func trySetReusePort(_ string, _ string, c syscall.RawConn) {
@@ -18,8 +18,12 @@ func trySetReusePort(_ string, _ string, c syscall.RawConn) {
})
}
-func isReusableSocket(uc *net.UDPConn) bool {
- rc, err := uc.SyscallConn()
+func isReusableSocket(pc nettype.PacketConn) bool {
+ sc, ok := pc.(syscall.Conn)
+ if !ok {
+ return false
+ }
+ rc, err := sc.SyscallConn()
if err != nil {
return false
}