mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-03-31 10:27:39 +03:00
auto-redirect: Fetch interfaces
This commit is contained in:
parent
aa9d9c6296
commit
d093b82064
1 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue