summaryrefslogtreecommitdiffhomepage
path: root/device
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2022-07-01 21:28:52 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2022-07-04 01:42:12 +0200
commitc31a7b1ab47807f01613a571cc480f79d5fb4181 (patch)
treef2b8488763ea41386c2d1f61eefc47e667ca7258 /device
parent6a08d81f6bc465a2276c61093d96e567d00beb24 (diff)
conn, device, tun: set CLOEXEC on fds
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device')
-rw-r--r--device/sticky_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/sticky_linux.go b/device/sticky_linux.go
index 6193ea3..97c14b5 100644
--- a/device/sticky_linux.go
+++ b/device/sticky_linux.go
@@ -204,7 +204,7 @@ func (device *Device) routineRouteListener(bind conn.Bind, netlinkSock int, netl
}
func createNetlinkRouteSocket() (int, error) {
- sock, err := unix.Socket(unix.AF_NETLINK, unix.SOCK_RAW, unix.NETLINK_ROUTE)
+ sock, err := unix.Socket(unix.AF_NETLINK, unix.SOCK_RAW|unix.SOCK_CLOEXEC, unix.NETLINK_ROUTE)
if err != nil {
return -1, err
}