|
|
@ -227,7 +227,8 @@ func (b *backend) CloseTUNs() {
|
|
|
|
b.devices.Shutdown()
|
|
|
|
b.devices.Shutdown()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (b *backend) NetworkChanged() {
|
|
|
|
// ifname is the interface name retrieved from LinkProperties on network change. If a network is lost, an empty string is passed in.
|
|
|
|
|
|
|
|
func (b *backend) NetworkChanged(ifname string) {
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
if p := recover(); p != nil {
|
|
|
|
if p := recover(); p != nil {
|
|
|
|
log.Printf("panic in NetworkChanged %s: %s", p, debug.Stack())
|
|
|
|
log.Printf("panic in NetworkChanged %s: %s", p, debug.Stack())
|
|
|
@ -235,6 +236,8 @@ func (b *backend) NetworkChanged() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the interface name and alert the monitor.
|
|
|
|
|
|
|
|
interfaces.UpdateLastKnownDefaultRouteInterface(ifname)
|
|
|
|
if b.sys != nil {
|
|
|
|
if b.sys != nil {
|
|
|
|
if nm, ok := b.sys.NetMon.GetOK(); ok {
|
|
|
|
if nm, ok := b.sys.NetMon.GetOK(); ok {
|
|
|
|
nm.InjectEvent()
|
|
|
|
nm.InjectEvent()
|
|
|
|