wgengine/netlog: include node OS in logged attributes (#17755)

Include the node's OS with network flow log information.

Refactor the JSON-length computation to be a bit more precise.

Updates tailscale/corp#33352
Fixes tailscale/corp#34030

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
Joe Tsai
2025-11-04 12:36:04 -08:00
committed by GitHub
parent db7dcd516f
commit 77123a569b
7 changed files with 31 additions and 19 deletions

View File

@@ -190,6 +190,7 @@ func TestToNode(t *testing.T) {
node: &tailcfg.Node{
StableID: "n123456CNTL",
Addresses: []netip.Prefix{prefix("100.1.2.3")},
Hostinfo: (&tailcfg.Hostinfo{OS: "linux"}).View(),
User: 12345,
},
user: &tailcfg.UserProfile{
@@ -199,6 +200,7 @@ func TestToNode(t *testing.T) {
want: netlogtype.Node{
NodeID: "n123456CNTL",
Addresses: []netip.Addr{addr("100.1.2.3")},
OS: "linux",
User: "user@domain",
},
},