Skip to content

gobridge: bridge monitor, live and file (increment 25) - #388

Merged
randomizedcoder merged 9 commits into
mainfrom
gobridge/monitor
Dec 5, 2026
Merged

randomizedcoder merged 9 commits into
mainfrom
gobridge/monitor

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

Increment 25: gobridge now clones bridge monitor, both live and with file F. That finishes gobridge's read side; only writes are still refused.

Commits

  • 25X (V110) groundwork:
    • print_nlmsg_timestamp moves from goip into internal/nlmon as TstampText;
    • tc's capture helper becomes mkMonHelper, with a new xtcp2-nl-brmon-ws that finds the monitor's socket by pid (a bare or all monitor clears the 0x8 bit tc's check uses);
    • a new hermetic check, nlcap-brmon-ws (13 rows); nlcap-tcmon still passes unchanged.
  • 25C (V111) the brmonitor capture space, 44 rows: 18 live, 12 file and batch, 14 negatives. Captured on two boots.
  • 25P (V112) pkg/xtcpnl: BrEventKind. TestWsBrMonitor decodes all 307 corpus events with the existing parsers and rejects none.
  • 25R (V113) gobridge: monitor.go and source_monitor.go. The batch state is copied from bridge: -t zeroed by shows, a banner that is never reset, and the socket monitor closes.
  • 25B (DOC035) upstream/iproute2-bridge-monitor.md completed, with a HEAD check of both trees.
  • 25L (V114) live diff on the workbench.
  • Two fix-ups: US spelling for kernel-citation-audit, and preallocation for lint-baseline tier 2.
  • A merge of main. The only conflict was the gobridge-status.md ledger, and both sides are kept: V110–V114 and DOC035, then V402.

Results

  • Corpus: all 44 brmonitor rows replay byte for byte, with stamps masked.
  • Live diff: gobridge and bridge 7.2.0 were identical on 44 of 44 rows, in two batches. This was on the same boot as the corpus, not a second boot, because the workbench VM is shared.
  • Tests:
    • TestGobridgeMonitorUnit: 31 rows;
    • fuzzing found nothing that gobridge gets wrong: FuzzGobridgeMonitorFile ran twice for 60 s (90k and 44k executions);
    • 8/8 mutants killed;
    • internal/gobridge coverage 82.6%.
  • Upstream (docs/netlink/upstream/, nothing sent to netdev):
    • B58–B76 and K10–K17. 20 leads confirmed by a row, B62 and K11 corrected, and B71 dropped.
    • New: B76 (an RTM_DELVLAN entry prints state disabled) and K17.
    • B20 extended: the fuzzer found that bridge monitor file F segfaults (rc 139) on a 36-byte RTM_NEWVLAN.
    • At iproute2 HEAD (d7e038f99479), every B lead is still present. At torvalds HEAD, every K note is unchanged.

Gates (at 39a7241, the merge)

  • test-go-race: pass
  • lint-baseline (tiers 0-2): pass
  • no-write-encoders: pass
  • kernel-citation-audit: pass
  • go test ./...: 113 packages pass. pkg/xtcp failed on TestTCPDest_writeTimeout.

That test is already flaky on main: it failed 3 of 20 runs (-count=20) on a clean main checkout. It checks the dropped counter as soon as the first write error is counted, but with attempts = 2 the drop is only counted after the second attempt, about 100 ms later. This branch doesn't touch pkg/xtcp, and the package passed on rerun.

🤖 Generated with Claude Code

randomizedcoder and others added 9 commits December 3, 2026 08:52
…X, V110)

- internal/nlmon gains NlmsgTstampCst and TstampText (print_nlmsg_timestamp),
  moved from goip, which now calls it; TestNlmonTstampText pins 9 rows.
- netlink-capture.nix: xtcp2-nl-tcmon's body becomes mkMonHelper; the new
  xtcp2-nl-brmon-ws finds bridge monitor's socket by its inode, since a
  bare monitor binds ~RTMGRP_TC and a vlan/vni one no group at all.
- nix/checks/nlcap-brmon-ws.nix: 13 hermetic rows; nlcap-tcmon unchanged.
- docs/netlink/upstream/iproute2-bridge-monitor.md: B58-B75 and K10-K16,
  predicted, not submitted to netdev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/nlcapgen's brmonitor space: 18 live rows of `bridge monitor`
under xtcp2-nl-brmon-ws over five fixtures (each selector with a NEW
and a DEL, bare, all, word order, prefixes, a plain dummy, -t, -j, -d,
-s); 12 file and batch rows over 19 records cut from the live rows' own
notifications; 14 negatives. Captured on the workbench (7.3.1, iproute2
7.2.0): two batches on one boot identical with stamps masked, the live
rows identical across boots. TestBrMonitorSpace pins one case per row,
the record files (each record's attributes end at its body's end), and
determinism.

upstream/iproute2-bridge-monitor.md: 20 leads confirmed with their
rows, B62 and K11 corrected, B71 dropped, B68 and B74 source only; new
B76 (vlan.c prints "state disabled" for an RTM_DELVLAN, which carries
no STATE) and K17 (a vlan add on a port notifies its local fdb entry).
iproute2-bridge-print-paths.md gains increment 25 lines on B28/B29 and
B30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BrEventKind names the bridge object of a monitor event as bridge's
accept_msg dispatches it: NEW and DEL of link, neigh, mdb, vlan and
tunnel, plus NLMSG_TSTAMP. TestWsBrMonitor decodes all 307 bridge
events in ws/brmonitor (pcaps and the ec rows' record files) with the
existing parsers and pins K11-K17 and B76 on the wire. Benchmarks for
both.

IsRtnetlinkEventType keeps its set: it mirrors ParseRtnetlinkEvent,
which has no arm for the bridge types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
monitor.go is bridge/monitor.c: do_monitor's words in its order (B59,
B60), the bind mask with BRVLAN and TUNNEL joins (B58), the file mode
with no ll_init_map and no selectors (B65, B66), accept_msg over
xtcpnl.BrEventKind with NLMSG_TSTAMP through nlmon, and print_headers
in each printer after its filters. The batch state bridge keeps is
copied: the closed rth (B63), the banner (B62) and the -t counter
every show zeroes (B64). source_monitor.go subscribes live or replays
a capture's notifications.

TestGobridgeMonitorCorpus replays all 44 brmonitor rows; the unit
table has 31 rows; the fuzz found B20 reachable through monitor file
(bridge 7.2.0 exits 139), recorded in the upstream docs. 8/8 mutants
killed, coverage 82.6%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…C, 25P, 25R)

kernel-citation-audit flags "neighbour" not preceded by a kernel path.
Comments and test descriptions only; the brmonitor rows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iproute2-bridge-monitor.md gains its HEAD check: at the mirror's main
d7e038f99479 every B lead is present (monitor.c, the printers, ll_map.c
and bridge.8 unchanged; the four libnetlink.c commits miss every lead),
and at torvalds 007722b8211f every K note's code is unchanged. The
summary's At HEAD column is filled. print-paths.md records that
1392041d fixes half of B3 and points to the new doc. gobridge.md gains
the increment 25 section. The doc checklist passes and catches four
mutated copies.

Not submitted to netdev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gobridge beside bridge 7.2.0 on the workbench, every brmonitor row, live
rows side by side with both monitors checked idle in recvmsg before the
trigger: stdout, stderr and rc identical on 44 of 44 in two batches,
stamps masked. bridge matches its 25C corpus on 44 of 44, on the corpus's
own boot (the shared VM was not rebooted). No new lead; B66 also seen
with the ifindexes shifted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prealloc flagged the monitor tests' record files and the brmonitor
command list. A recs helper sizes the file once; cmds starts with its
capacity. The generated rows are byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The only conflict is the gobridge-status.md ledger: both sides kept,
increment 25's V110-V114 and DOC035, then main's V402 (6C fresh boots).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit b48fe1b into main Dec 5, 2026
1 check passed
randomizedcoder added a commit that referenced this pull request Dec 5, 2026
docs(upstream): the bridge monitor note's index row, and the DOC035 collision (PR #388's gap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant