From 7f03c0f8fec00fd2360408b51d8bcb81444fd169 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 31 Mar 2021 09:51:55 -0700 Subject: [PATCH] wgengine/wgcfg/nmcfg: reduce some logging when a /0 route skipped Signed-off-by: Brad Fitzpatrick --- wgengine/wgcfg/nmcfg/nmcfg.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgengine/wgcfg/nmcfg/nmcfg.go b/wgengine/wgcfg/nmcfg/nmcfg.go index 8bd807ecf..fb75fb923 100644 --- a/wgengine/wgcfg/nmcfg/nmcfg.go +++ b/wgengine/wgcfg/nmcfg/nmcfg.go @@ -85,8 +85,14 @@ func WGCfg(nm *netmap.NetworkMap, logf logger.Logf, flags netmap.WGConfigFlags, } } } + didExitNodeWarn := false for _, allowedIP := range peer.AllowedIPs { if allowedIP.Bits == 0 && peer.StableID != exitNode { + if didExitNodeWarn { + // Don't log about both the IPv4 /0 and IPv6 /0. + continue + } + didExitNodeWarn = true logf("[v1] wgcfg: skipping unselected default route from %q (%v)", nodeDebugName(peer), peer.Key.ShortString()) continue } else if allowedIP.IsSingleIP() && tsaddr.IsTailscaleIP(allowedIP.IP) && (flags&netmap.AllowSingleHosts) == 0 {