mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-24 00:40:26 +00:00
Reduce network environment update overhead
This commit is contained in:
+1
-1
@@ -291,7 +291,7 @@ func (r *NetworkManager) InterfaceFinder() control.InterfaceFinder {
|
||||
}
|
||||
|
||||
func (r *NetworkManager) UpdateInterfaces() error {
|
||||
defer r.updateNetworkEnvironment()
|
||||
defer r.postUpdateNetworkEnvironment()
|
||||
if r.platformInterface == nil || !r.platformInterface.UsePlatformNetworkInterfaces() {
|
||||
return r.interfaceFinder.Update()
|
||||
} else {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func systemGateways(interfaceIndex int) []netip.Addr {
|
||||
rib, err := route.FetchRIB(unix.AF_UNSPEC, route.RIBTypeRoute, 0)
|
||||
rib, err := route.FetchRIB(unix.AF_UNSPEC, route.RIBType(unix.NET_RT_FLAGS), unix.RTF_GATEWAY)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user