net/udprelay: apply netns Control func to server socket(s)
To prevent peer relay servers from sending packets *over* Tailscale. Updates tailscale/corp#35651 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
committed by
Jordan Whited
parent
4c37141ab7
commit
5f34f14e14
@@ -12,11 +12,10 @@ import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func listenControl(_ string, _ string, c syscall.RawConn) error {
|
||||
func trySetReusePort(_ string, _ string, c syscall.RawConn) {
|
||||
c.Control(func(fd uintptr) {
|
||||
unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func isReusableSocket(uc *net.UDPConn) bool {
|
||||
|
||||
Reference in New Issue
Block a user