wgengine/filter: only log packets to/from non-default routes.

Fixes tailscale/corp#1429.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-03-09 16:10:30 -08:00
committed by Dave Anderson
parent ef7bac2895
commit a7f12a110a
5 changed files with 181 additions and 16 deletions

View File

@ -116,6 +116,12 @@ func (q *Parsed) Decode(b []byte) {
}
}
// StuffForTesting makes Parsed contain a len-bytes buffer. Used in
// tests to build up a synthetic parse result with a non-zero buffer.
func (q *Parsed) StuffForTesting(len int) {
q.b = make([]byte, len)
}
func (q *Parsed) decode4(b []byte) {
if len(b) < ip4HeaderLength {
q.IPVersion = 0