From e1425713974c7c432ded6f2595f511c69a6064db Mon Sep 17 00:00:00 2001 From: James 'zofrex' Sanderson Date: Fri, 14 Feb 2025 15:25:48 +0000 Subject: [PATCH] ipn/ipnlocal: add GetFilterForTest (#15025) Needed to test full packet filter in e2e tests. See tailscale/corp#26596 Updates tailscale/corp#20514 Signed-off-by: James Sanderson --- ipn/ipnlocal/local.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 25f4d552f..e09061041 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -1438,6 +1438,10 @@ func (b *LocalBackend) peerCapsLocked(src netip.Addr) tailcfg.PeerCapMap { return nil } +func (b *LocalBackend) GetFilterForTest() *filter.Filter { + return b.filterAtomic.Load() +} + // SetControlClientStatus is the callback invoked by the control client whenever it posts a new status. // Among other things, this is where we update the netmap, packet filters, DNS and DERP maps. func (b *LocalBackend) SetControlClientStatus(c controlclient.Client, st controlclient.Status) {