Skip to content

Commit

Permalink
Merge pull request wlynxg#3 from bobrofon/zone-cache-starvation
Browse files Browse the repository at this point in the history
Always update network interfaces information in cache
  • Loading branch information
wlynxg authored Aug 2, 2024
2 parents 3c18219 + 4198e44 commit 4d6caa2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions interface_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func Interfaces() ([]net.Interface, error) {
return nil, &net.OpError{Op: "route", Net: "ip+net", Source: nil, Addr: nil, Err: err}
}
if len(ift) != 0 {
zoneCache.update(ift, false)
zoneCacheX.update(ift, false)
zoneCache.update(ift, true)
zoneCacheX.update(ift, true)
}
return ift, nil
}
Expand Down Expand Up @@ -94,8 +94,8 @@ func InterfaceByName(name string) (*net.Interface, error) {
return nil, &net.OpError{Op: "route", Net: "ip+net", Source: nil, Addr: nil, Err: err}
}
if len(ift) != 0 {
zoneCache.update(ift, false)
zoneCacheX.update(ift, false)
zoneCache.update(ift, true)
zoneCacheX.update(ift, true)
}
for _, ifi := range ift {
if name == ifi.Name {
Expand Down

0 comments on commit 4d6caa2

Please sign in to comment.