From 7df256f428f5aee8ab7dde019bbb56b4d1b4eae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 7 Jan 2025 19:01:54 +0800 Subject: [PATCH] auto-redirect: Fetch interfaces --- redirect_nftables.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redirect_nftables.go b/redirect_nftables.go index be86114..02a9ca8 100644 --- a/redirect_nftables.go +++ b/redirect_nftables.go @@ -32,6 +32,10 @@ func (r *autoRedirect) setupNFTables() error { return err } + err = r.interfaceFinder.Update() + if err != nil { + return err + } r.localAddresses = common.FlatMap(r.interfaceFinder.Interfaces(), func(it control.Interface) []netip.Prefix { return common.Filter(it.Addresses, func(prefix netip.Prefix) bool { return it.Name == "lo" || prefix.Addr().IsGlobalUnicast()