From 5a99940dfa31002501097547fc26e4f6227e24e5 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 23 Aug 2024 11:43:12 -0700 Subject: [PATCH] tstest/natlab/vnet: explicitly ignore PCP and SSDP UDP queries So we don't log about them when verbose logging is enabled. Updates #13038 Change-Id: I925bc3a23e6c93d60dd4fb4bf6a4fdc5a326de95 Signed-off-by: Brad Fitzpatrick --- tstest/natlab/vnet/vnet.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tstest/natlab/vnet/vnet.go b/tstest/natlab/vnet/vnet.go index d8696206b..b677a7b66 100644 --- a/tstest/natlab/vnet/vnet.go +++ b/tstest/natlab/vnet/vnet.go @@ -66,7 +66,12 @@ import ( ) const nicID = 1 -const stunPort = 3478 + +const ( + stunPort = 3478 + pcpPort = 5351 + ssdpPort = 1900 +) func (s *Server) PopulateDERPMapIPs() error { out, err := exec.Command("tailscale", "debug", "derp-map").Output() @@ -1115,6 +1120,13 @@ func (n *network) HandleEthernetIPv4PacketForRouter(ep EthernetPacket) { return } + if isUDP && (udp.DstPort == pcpPort || udp.DstPort == ssdpPort) { + // We handle NAT-PMP, but not these yet. + // TODO(bradfitz): handle? marginal utility so far. + // Don't log about them being unknown. + return + } + //log.Printf("Got packet: %v", packet) }