Reduce network environment update overhead

This commit is contained in:
世界
2026-08-31 20:55:53 +08:00
parent 650ef881c8
commit 3e185071eb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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
}