mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 03:31:39 +00:00
net/netmon: when a new network is added, trigger netmon update (#10840)
Fixes #10107
This commit is contained in:
parent
236531c5fc
commit
c9fd166cc6
@ -478,6 +478,28 @@ func (m *Monitor) IsMajorChangeFrom(s1, s2 *interfaces.State) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Iterate over s2 in case there is a field in s2 that doesn't exist in s1
|
||||||
|
for iname, i := range s2.Interface {
|
||||||
|
if iname == m.tsIfName {
|
||||||
|
// Ignore changes in the Tailscale interface itself.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ips := s2.InterfaceIPs[iname]
|
||||||
|
if !m.isInterestingInterface(i, ips) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
i1, ok := s1.Interface[iname]
|
||||||
|
if !ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
ips1, ok := s1.InterfaceIPs[iname]
|
||||||
|
if !ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if !i.Equal(i1) || !prefixesMajorEqual(ips, ips1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user