Commit Graph

6 Commits (249938bfc400ecd17f0250ee0431a7edce86adf6)

Author SHA1 Message Date
Jonathan Nobels 249938bfc4 ipn/ipnlocal, net/netmon: fix tests and cleanup docs
updates tailscale/corp#33891

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 week ago
Jonathan Nobels 0699f847b9 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
1 week ago
Claus Lensbøl ce752b8a88
net/netmon: remove usage of direct callbacks from netmon (#17292)
The callback itself is not removed as it is used in other repos, making
it simpler for those to slowly transition to the eventbus.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2 months ago
Brad Fitzpatrick 8b48f3847d net/netmon, wgengine/magicsock: simplify LinkChangeLogLimiter signature
Remove the need for the caller to hold on to and call an unregister
function. Both two callers (one real, one test) already have a context
they can use. Use context.AfterFunc instead. There are no observable
side effects from scheduling too late if the goroutine doesn't run sync.

Updates #17148

Change-Id: Ie697dae0e797494fa8ef27fbafa193bfe5ceb307
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
3 months ago
David Anderson 5399fa159a net/netmon: publish events to event bus
Updates #15160

Signed-off-by: David Anderson <dave@tailscale.com>
8 months ago
Andrew Dunham 640b2fa3ae net/netmon, wgengine/magicsock: be quieter with portmapper logs
This adds a new helper to the netmon package that allows us to
rate-limit log messages, so that they only print once per (major)
LinkChange event. We then use this when constructing the portmapper, so
that we don't keep spamming logs forever on the same network.

Updates #13145

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I6e7162509148abea674f96efd76be9dffb373ae4
9 months ago