From 1011e64ad7d16e5f76f3e94fa4ff000a3741ce5e Mon Sep 17 00:00:00 2001
From: Andrew Dunham <andrew@du.nham.ca>
Date: Wed, 21 Dec 2022 11:56:14 -0500
Subject: [PATCH] wgengine/monitor: don't log unhandled RTM_{NEW,DEL}LINK
 messages

These aren't handled, but it's not an error to get one.

Fixes #6806

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I1fcb9032ac36420aa72a048bf26f58360b9461f9
---
 wgengine/monitor/monitor_linux.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/wgengine/monitor/monitor_linux.go b/wgengine/monitor/monitor_linux.go
index 9b490903b..376c90315 100644
--- a/wgengine/monitor/monitor_linux.go
+++ b/wgengine/monitor/monitor_linux.go
@@ -228,6 +228,10 @@ func (c *nlConn) Receive() (message, error) {
 			c.logf("%+v", rdm)
 		}
 		return rdm, nil
+	case unix.RTM_NEWLINK, unix.RTM_DELLINK:
+		// This is an unhandled message, but don't print an error.
+		// See https://github.com/tailscale/tailscale/issues/6806
+		return unspecifiedMessage{}, nil
 	default:
 		c.logf("unhandled netlink msg type %+v, %q", msg.Header, msg.Data)
 		return unspecifiedMessage{}, nil