From bd9cf42b96dd11c9483cadc3018b23a1adf671bf Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sat, 1 Nov 2025 14:27:13 +0100 Subject: [PATCH] types: NodeView CanAccess uses internal Signed-off-by: Kristoffer Dalby --- hscontrol/types/node.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/hscontrol/types/node.go b/hscontrol/types/node.go index bf42dcd1..50b9b049 100644 --- a/hscontrol/types/node.go +++ b/hscontrol/types/node.go @@ -698,27 +698,11 @@ func (v NodeView) InIPSet(set *netipx.IPSet) bool { } func (v NodeView) CanAccess(matchers []matcher.Match, node2 NodeView) bool { - if !v.Valid() || !node2.Valid() { + if !v.Valid() { return false } - src := v.IPs() - allowedIPs := node2.IPs() - for _, matcher := range matchers { - if !matcher.SrcsContainsIPs(src...) { - continue - } - - if matcher.DestsContainsIP(allowedIPs...) { - return true - } - - if matcher.DestsOverlapsPrefixes(node2.SubnetRoutes()...) { - return true - } - } - - return false + return v.ж.CanAccess(matchers, node2.AsStruct()) } func (v NodeView) CanAccessRoute(matchers []matcher.Match, route netip.Prefix) bool {