You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net/netmon
Jonathan Nobels 2b7f8b6be7 net/netmon: remove ChangeDelta.Major and start the TODOs
updates tailscale/corp#33891

We've had some TODO's in netmon for ages related to asking
more pointed questions of ChangeDelta.  We're also seeing
a lot of ChangeDelta's being flagged as "Major" when they are
not interesting, triggering rebinds in wgengine that are not needed.

This removes the "Major" flag and replaces it with a set of
precomputed values that hint at what the ChangeDelta means.

 The dependencies are cleaned up a bit,
notably removing dependency on netmon itself for calculating
what is interesting, and what is not.  This includes letting
individual platforms set a bespoke global "IsInterestingInterface"
function.  This was only used on Darwin.

RebindRequired roughly flows from how "Major" was historically
calculated but includes some additional checks for various
uninteresting events such as changes in interface addresses that
shouldn't trigger a rebind to minimize thrashing.   The individual
values that we roll  into RebindRequired are also exposed so that
components consuming netmap.ChangeDelta can ask more
targeted questions.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>

wgengine/userspace: skip rebind and restun if all of our interfaces are down

updates tailscale/corp#33891

Skip rebind and restun if we have called SetNetworkUp with false.  Neither
cares about this state and it's just flappy to try to reStun and rebind if
there are no usable interfaces available.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>

Add viability flag and fix bug in state
22 hours ago
..
defaultroute_bsd.go net/netmon: swap to swift-derived defaultRoute on macos (#11936) 2 years ago
defaultroute_darwin.go net/{netns, netmon}: use LastKnownDefaultInterface if set and check for utun (#16873) 4 months ago
interfaces_android.go types/result, util/lineiter: add package for a result type, use it 1 year ago
interfaces_bsd.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
interfaces_darwin.go syncs: add Mutex/RWMutex alias/wrappers for future mutex debugging 3 weeks ago
interfaces_darwin_test.go net/{netns, netmon}: use LastKnownDefaultInterface if set and check for utun (#16873) 4 months ago
interfaces_default_route_test.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
interfaces_defaultrouteif_todo.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
interfaces_freebsd.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
interfaces_linux.go feature/featuretags: add features for c2n, peerapi, advertise/use routes/exit nodes 2 months ago
interfaces_linux_test.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
interfaces_test.go net/netmon: use Monitor's tsIfName if set by SetTailscaleInterfaceName 9 months ago
interfaces_windows.go feature, net/tshttpproxy: pull out support for using proxies as a feature 2 months ago
interfaces_windows_test.go net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
loghelper.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
loghelper_test.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon_darwin.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon_darwin_test.go all: move network monitoring from wgengine/monitor to net/netmon 3 years ago
netmon_freebsd.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon_linux.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon_linux_test.go types/result, util/lineiter: add package for a result type, use it 1 year ago
netmon_polling.go net/netmon: publish events to event bus 8 months ago
netmon_test.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
netmon_windows.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
polling.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago
state.go net/netmon: remove ChangeDelta.Major and start the TODOs 22 hours ago