From 08d91f4b9094ecabd826efe5ad1947fc31e24824 Mon Sep 17 00:00:00 2001 From: Mazdak Nasab Date: Wed, 25 Nov 2026 11:02:25 -0700 Subject: [PATCH] feature/conn25: use transitIPInPool in connector.packetFilterAllow (#22660) packetFilterAllow inlined the same per-family transit pool lookup that transitIPInPool already does. Call that instead. Also fix a doc comment that said it checked the packet's Src, but it has always checked Dst. Updates #cleanup Change-Id: I1f236c5120168a0a8b16f8125773efcb09426bc8 Signed-off-by: Mazdak Nasab --- feature/conn25/connector.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/feature/conn25/connector.go b/feature/conn25/connector.go index 9cdf10290..dcee25d6b 100644 --- a/feature/conn25/connector.go +++ b/feature/conn25/connector.go @@ -149,14 +149,10 @@ func (c *connector) destinationInPools(dst netip.Addr) bool { return (magic != nil && magic.Contains(dst)) || (transit != nil && transit.Contains(dst)) } -// packetFilterAllow returns true if the provided packet has a Src that is in +// packetFilterAllow returns true if the provided packet has a Dst that is in // the configured transit IP range for this connector, false otherwise. func (c *connector) packetFilterAllow(p packet.Parsed) (bool, string) { - ipSets := c.getIPSets() - if ipSets.v4Transit != nil && ipSets.v4Transit.Contains(p.Dst.Addr()) { - return true, packetFilterAllowReason - } - if ipSets.v6Transit != nil && ipSets.v6Transit.Contains(p.Dst.Addr()) { + if c.transitIPInPool(p.Dst.Addr()) { return true, packetFilterAllowReason } return false, ""