net/interfaces: include DefaultRouteInterface in interfaces.State

And log it in wgengine on change. Changing bug in #643.

Updates #643
This commit is contained in:
Brad Fitzpatrick
2020-08-12 12:48:34 -07:00
parent 75225368a4
commit b97aac1718
3 changed files with 26 additions and 1 deletions

View File

@@ -212,6 +212,7 @@ func newUserspaceEngineAdvanced(conf EngineConfig) (_ Engine, reterr error) {
}
e.localAddrs.Store(map[packet.IP]bool{})
e.linkState, _ = getLinkState()
logf("link state: %+v", e.linkState)
// Respond to all pings only in fake mode.
if conf.Fake {
@@ -1105,7 +1106,11 @@ func (e *userspaceEngine) LinkChange(isExpensive bool) {
cur.IsExpensive = isExpensive
needRebind := e.setLinkState(cur)
e.logf("LinkChange(isExpensive=%v); needsRebind=%v", isExpensive, needRebind)
if needRebind {
e.logf("LinkChange: major, rebinding. New state: %+v", cur)
} else {
e.logf("LinkChange: minor")
}
why := "link-change-minor"
if needRebind {