Commit Graph

7 Commits (dd952713eee8017d1471f2cd2e2ade7b6eda88d3)

Author SHA1 Message Date
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
David Anderson 5399fa159a net/netmon: publish events to event bus
Updates #15160

Signed-off-by: David Anderson <dave@tailscale.com>
8 months ago
James Tucker 80a100b3cb net/netmon: add extra panic guard around ParseRIB
We once again have a report of a panic from ParseRIB. This panic guard
should probably remain permanent.

Updates #14201

This reverts commit de9d4b2f88.

Signed-off-by: James Tucker <james@tailscale.com>
10 months ago
James Tucker de9d4b2f88 net/netmon: remove extra panic guard around ParseRIB
This was an extra defense added for #14201 that is no longer required.

Fixes #14201

Signed-off-by: James Tucker <james@tailscale.com>
11 months ago
James Tucker 4d33f30f91 net/netmon: improve panic reporting from #14202
I was hoping we'd catch an example input quickly, but the reporter had
rebooted their machine and it is no longer exhibiting the behavior. As
such this code may be sticking around quite a bit longer and we might
encounter other errors, so include the panic in the log entry.

Updates #14201
Updates #14202
Updates golang/go#70528

Signed-off-by: James Tucker <james@tailscale.com>
1 year ago
James Tucker f6431185b0 net/netmon: catch ParseRIB panic to gather buffer data
Updates #14201
Updates golang/go#70528

Signed-off-by: James Tucker <james@tailscale.com>
1 year ago
Mihai Parparita 4722f7e322 all: move network monitoring from wgengine/monitor to net/netmon
We're using it in more and more places, and it's not really specific to
our use of Wireguard (and does more just link/interface monitoring).

Also removes the separate interface we had for it in sockstats -- it's
a small enough package (we already pull in all of its dependencies
via other paths) that it's not worth the extra complexity.

Updates #7621
Updates #7850

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
3 years ago