Skip to content

Commit

Permalink
auto-redirect: Fetch interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jan 7, 2025
1 parent aa9d9c6 commit d093b82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redirect_nftables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d093b82

Please sign in to comment.