From 997678f5406ad9e275601960333313e5b829652d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 17 Feb 2020 11:28:07 -0800 Subject: [PATCH] wgengine/monitor: make Close not block forever on Linux Signed-off-by: Brad Fitzpatrick --- wgengine/monitor/monitor_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wgengine/monitor/monitor_linux.go b/wgengine/monitor/monitor_linux.go index 8dc75840b..e882e841d 100644 --- a/wgengine/monitor/monitor_linux.go +++ b/wgengine/monitor/monitor_linux.go @@ -6,6 +6,7 @@ import ( "fmt" + "time" "github.com/mdlayher/netlink" "golang.org/x/sys/unix" @@ -45,6 +46,7 @@ func newOSMon() (osMon, error) { } func (c *nlConn) Close() error { + c.conn.SetDeadline(time.Unix(0, 0)) // abort any Receive in flight return c.conn.Close() }