From b4abea0e0df208bfd05cd62826e92ccc7a2e3035 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Fri, 4 Dec 2026 02:26:29 -0800 Subject: [PATCH] feat(gobridge): close 6C - two fresh-boot batches over the bridge corpus (V402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last task of the gobridge arc: the 6C gate's fresh-boot batches, and 7C's conditional ("if the shared VM is free, two fresh-boot batches for both 6C and 7C") now that the workbench VM was free. Two batches, each on its own fresh boot, all four ws/bridge* row files, 344 of 344 rows each: nlcapgen verdiff agrees with the committed corpus everywhere but the named timer rows (bridgex ec-021/022/023 and pw-021/022/023; bridgemdb ec-005/006/008 and pw-005/006/008), boot against boot the same 0/6/0/6. A body-level pass (a throwaway, deleted; seq and pid zeroed) finds only V097's two classes: IFLA_BRPORT_FORWARD_DELAY_TIMER and the NLMSG_ERROR bodies' echoed request seq. The committed corpus is unchanged. The first fresh-boot attempt lost 34 of 113 rows: the batch fired 24 s after qemu started, xtcp2-nlcap-ws's up returning at ssh while the guest's systemd still settled, the first wave's rows crosstalked at their ns lifecycle ("Cannot open network namespace" right after NLCAP_NS_OK, "Cannot create namespace file: File exists", a pre step's br0 vanishing between two pre steps, NLCAP_CAP_NOBIND with datagrams=0). The mechanism is not pinned down; the wait is measured - the same boot two hours later was 113 of 113, and a concurrent session's 44-row batch on the same boot ran clean. up now waits for is-system-running (running or degraded) before NLCAP_WS_UP, warning past the timeout. Also recorded in V402: the arc's disk arc - the kernel closure was GC'd twice (nothing pinned nix build --no-link, the store 98-99% full; the linux-7.3.1 build needs ~35 GB and failed twice at 31-36 GB free), and two CLI attempts were killed at their own command timeouts against the 45-min kernel rebuild; the closure is now rooted at /tmp/gobridge-vm-root. Gates: the batch's own, and nlcap-ws (the CLI's shellcheck through its build), nix-fmt, test-goip-docs, netlink-audit, lint-baseline. 🤖 Generated with [pi](https://github.com/badlogic/pi-mono) --- docs/netlink/gobridge-status.md | 19 ++++++++++-------- docs/netlink/gobridge.md | 11 +++++++++++ nix/microvms/workbench/xtcp2-nlcap-ws.sh | 25 ++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/docs/netlink/gobridge-status.md b/docs/netlink/gobridge-status.md index 0be95e327..6687d608a 100644 --- a/docs/netlink/gobridge-status.md +++ b/docs/netlink/gobridge-status.md @@ -1,6 +1,6 @@ # gobridge (bridge link, vlan, vni, mst, fdb, mdb): implementation status -**Last updated:** 2026-11-23 +**Last updated:** 2026-12-04 **Summary:** - The design and task plan are in [gobridge.md](gobridge.md); this document tracks @@ -14,11 +14,13 @@ - **6B-0 (bug classes): done.** `upstream/bug-classes.md` distils the prior iproute2 findings into fifteen classes, each with examples and a recipe for finding it. The plan's leads B1-B17 came from it, and 6C adds more (DOC031). -- **6C (capture): in progress.** `matrix_bridge.go` writes 113 rows over nine fixtures, +- **6C (capture): done.** `matrix_bridge.go` writes 113 rows over nine fixtures, and `pkg/xtcpnl/testdata/7_3_1/ws/bridge/` holds the corpus. Two batches on one boot agree on rc, stdout, stderr, message types and flags. The rows confirm B1, B2, B3, B5, - B6, B10, B21, B22 and B24 live, and add B25 and B26 (V097). Left: a batch on a fresh boot, - which waits until the shared workbench VM is free. + B6, B10, B21, B22 and B24 live, and add B25 and B26 (V097). The fresh-boot half closed + 2026-12-04: two batches on two fresh boots, 344 of 344 rows over the four `ws/bridge*` + families each, everything but the named timer rows and the NLMSG_ERROR echoed seqs + byte for byte (V402). - **6P (parsers): done.** `ParseBridgeLink` (AF_BRIDGE RTM_NEWLINK), `ParseTunnelMsg` (RTM_NEWTUNNEL) and `ParseBrVlanTables` (RTM_NEWVLAN as tables), over a new `AttrTable` that mirrors iproute2's `tb[]`. Two new request builders, @@ -91,7 +93,7 @@ | Increment | Work | State | Evidence | |---|---|---|---| -| 6 — bridge | wsreplay → capture → parser → tests → `gobridge` clone → bug hunt | in progress | V096, DOC031, V097, V098, V099, DOC032, V100 | +| 6 — bridge | wsreplay → capture → parser → tests → `gobridge` clone → bug hunt | done | V096, DOC031, V097, V098, V099, DOC032, V100, V402 | | 6X — bridge, the rest | batch, force, netns, family, router ports: capture → parser → clone → bug hunt → live | done | V101, V102, V103, DOC033, V104 | | 7 — fdb and mdb | readbacks → capture → parser → clone → bug hunt → live | done | V105, V106, V107, V108, DOC034, V109 | @@ -101,7 +103,7 @@ |---|---|---|---|---| | [x] | 6S | extract `internal/wsreplay`; govdpa/gotipc/godevlink become thin wrappers | done | V096 | | [x] | 6B-0 | `upstream/bug-classes.md`: the bug-class checklist from the 12 prior docs | done | DOC031 | -| [ ] | 6C (NC-BR) | `matrix_bridge.go`, two-boot capture | in progress (fresh-boot batch left) | V097 | +| [x] | 6C (NC-BR) | `matrix_bridge.go`, two-boot capture | done | V097, V402 | | [x] | 6P (NP-BR) | `xtcpnl_bridge_link.go`, `xtcpnl_vnifilter.go` + table tests + fuzz + O3/O4 | done | V098 | | [x] | 6R (NR-BR) | `gobridge` clone + corpus/unit/imports tests + nix pkg | done | V099, V100 | | [x] | 6B | audit `bridge/*.c` against the checklist, record findings only | done | DOC032 | @@ -123,7 +125,7 @@ |---|---|---| | V096 | 6S | **Package:** `internal/wsreplay` (`replay.go`) holds `Msg`, `Reply`, `SplitMsgs`, `HeaderLen`, the request/reply transaction split, `Replay.Talk`/`Pending`, `New(datagrams, opts)` and `Open(path, opts)`. `Options` carries what differed between the three copies: the clone's `ErrReplay` sentinel (every error wraps it, so `errors.Is` callers are unchanged), the `Canon` hook (`CanonSeqPID` by default; `CanonGenlCmd` also zeroes the genl command and version, as godevlink did), and the two names in the mismatch message, with the shorter padded so the hex lines align as before. **Clones:** `internal/{govdpa,gotipc,godevlink}/source.go` now hold type aliases `Msg`/`Reply`, their `Source` interface and sentinels, `netlinkHeaderLen`, and a `ReplaySource` that embeds `*wsreplay.Replay`. gotipc's still carries `Own`/`Addr`, `OwnAddr` and `NodeName`, so its unit tests' `ReplaySource{Own: …}` literals compile unchanged. **Imports guards:** the three closures gain `internal/wsreplay`. They also gain `pkg/strpolicy`: it was already failing on `main`, because PR #308 made xtcpnl's congestion-name decoder import it after #309's closures were written. gordma's guard already listed it. **Tests:** `TestReplay` has 14 rows, each with `description` and `expected`. Positive: a match; seq/pid ignored. Negative: a body differs; more requests than captured; a missing file and a non-pcap both wrap the sentinel. Boundary: an empty pcap; a DONE-only reply; a request with no reply. Corner: a multi-message datagram split in order; a reply before any request dropped; a truncated trailing message; `CanonGenlCmd` ignores the command byte while the default matches it. `TestMismatchAlignment` has 4 rows: govdpa/vdpa, godevlink/devlink, equal names, tool longer than clone. Coverage is 93.7%. `go test ./internal/wsreplay/ ./internal/govdpa/ ./internal/gotipc/ ./internal/godevlink/ ./internal/goip/` passes, with the three corpus tests unchanged. Also run: vet, gofmt, `lint-baseline`. | | DOC031 | 6B-0 | **Doc:** `docs/netlink/upstream/bug-classes.md`, marked "Not submitted to netdev". It reads the twelve prior finding docs (bond, devlink, fou, mptcp, tipc, vdpa; and P, lwt, nh, rt, rta, ethtool, which are still working-tree docs) and sorts their ~70 findings into fifteen classes: C1 wrong attribute width, C2 print width or sign, C3 no presence or length check, C4 unbounded index, C5 `-j` ignored, C6 JSON broken on an error path, C7 JSON keys or types that vary, C8 wrong exit status, C9 argument parsing, C10 message text, C11 buffers and request bytes, C12 crash on a reachable path, C13 output before success (new with bridge), C14 filter logic, C15 kernel quirks. Each class lists its prior examples and a grep or reading recipe. "How to apply it" sets the order: read the code, cross-check widths against the kernel, pin every lead with a row, confirm against the newest upstream code, and record only. Applied to `bridge/*.c` it gave the plan's B1-B17 ([gobridge.md](gobridge.md)). | -| V097 | 6C | **Rows:** `tools/nlcapgen/matrix_bridge.go` generates `nix/microvms/workbench/bridge.rows.jsonl`: 113 rows, 44 commands × plain/`-j` plus 25 negatives, registered as family `bridge` in `nlcapgen/main.go`. Every row is `proto route` with modules `bridge`,`vxlan`, in its own namespace (no `initns`, no `serial`). **Fixtures:** `bare`; `br` (br0 `vlan_filtering 1`, dummy ports d1/d2, d1 vid 10 pvid untagged and 20-25, d2 vid 30, br0 vid 10 self, d2 `learning off cost 7 priority 5 hairpin on`); `brglob` (`mcast_vlan_snooping 1`, vid 10 `mcast_snooping 0 mcast_igmp_version 3`); `brmst` (`mst_enabled 1` at creation, vid 10 → MSTI 3, d1 state learning in it); `brmstnov` (MST on, d2 with no VLAN); `vxtun` (external vxlan vx0 as a port, `vlan_tunnel on`, vid 100 → 1000 and 200-202 → 2000-2002); `brwide` (d3 with vids 2-4094); `vnif` (vnifilter vxlan vx1 over dummy d9, VNIs 100-102, 200 group 239.1.1.1, 300 remote 2001:db8::1, 16777214-16777215); `brmaster` (a port named `master`). Every device has a fixed MAC and `addrgenmode none` before up. **Setup lessons:** MST can be enabled only while no port has VLANs (EBUSY, "MST mode can't be changed while VLANs exist"), so `brmst` sets it when br0 is made. A `tunnel_info` for a VLAN not yet on the port is a bare EINVAL with no extack (K2), so the VLAN is added first. `ip` reads a bare `master` as its keyword, so `brmaster` uses `name master`/`dev master`. **Options:** `-c` is `-color` (matched before `-compressvlans`) and compression is `-com`; the `-c vlan show` rows capture the ANSI colour, and under `-j` there is none. **Pinned by** `TestBridgeSpace`: 31 outcome rows (positive, negative, boundary and corner, each with description and expected), 6 fixture-order rows, a plain/`-j` pairing check, an addrgenmode-before-up check over every step, the row count, and a determinism check. **Live outcomes:** all 113 rows match their expected rc. Unknown option, unknown object and `help` exit 255 before any request. Unknown sub-commands, `vni sh` (strcmp), `vlan global sh` (B21), `vlan help`, `link show dev` (incomplete), duparg on `dev`/`vid`, and B1 are ack-then-fail, rc 255. nodev on each object's filter is kernel ENODEV from `ll_link_get`, rc 255. `vni show dev d1` is kernel EINVAL with extack "The device is not a vxlan device", rc 1, and prints "Dump ternminated" (B3). `vlan show dev if999` is rc 0 with the kernel's ENODEV ignored (B24). B10: with MST off, `mst show` prints its header and "Dump terminated", rc 255 (`-j` prints `[]`). On `brmstnov`, `mst show dev d1` prints d1's entry before aborting on d2. **JSON:** every `-j` stdout parses. `-j -s vlan show` keys VLANs `"vid"` where the other shows use `"vlan"` (B25), and compressed ranges print `"flags": []` (B26). **Corpus test:** a failed dump's extack comes in NLMSG_DONE (the int error, then TLVs, with no echoed request), which `wsObserve` did not read. `wsDoneExtack` now reads it, pinned by `TestWsDoneExtack` (8 rows). `go test ./pkg/xtcpnl/ -run Ws` passes over the new corpus. **Determinism:** batches A and B ran back to back on one boot of the shared workbench VM (113/113 OK each). Batch B is committed: 113 row dirs, 360 KB. `ip.rc`, `ip.err` and `ip.out` are identical on all 113 rows, and so are message types and flags. Bodies differ only in RTM_NEWLINK (IFF_RUNNING and IFLA_OPERSTATE from linkwatch timing, in `ll_init_map`'s AF_UNSPEC dump, which bridge never prints; IFLA_BRPORT_FORWARD_DELAY_TIMER, a live timer) and in the NLMSG_ERROR of the nodev rows, which echoes iproute2's time-based seq. **Not yet done:** the fresh-boot batch. Another session had the VM up and in use, so it was not rebooted under them. | +| V097 | 6C | **Rows:** `tools/nlcapgen/matrix_bridge.go` generates `nix/microvms/workbench/bridge.rows.jsonl`: 113 rows, 44 commands × plain/`-j` plus 25 negatives, registered as family `bridge` in `nlcapgen/main.go`. Every row is `proto route` with modules `bridge`,`vxlan`, in its own namespace (no `initns`, no `serial`). **Fixtures:** `bare`; `br` (br0 `vlan_filtering 1`, dummy ports d1/d2, d1 vid 10 pvid untagged and 20-25, d2 vid 30, br0 vid 10 self, d2 `learning off cost 7 priority 5 hairpin on`); `brglob` (`mcast_vlan_snooping 1`, vid 10 `mcast_snooping 0 mcast_igmp_version 3`); `brmst` (`mst_enabled 1` at creation, vid 10 → MSTI 3, d1 state learning in it); `brmstnov` (MST on, d2 with no VLAN); `vxtun` (external vxlan vx0 as a port, `vlan_tunnel on`, vid 100 → 1000 and 200-202 → 2000-2002); `brwide` (d3 with vids 2-4094); `vnif` (vnifilter vxlan vx1 over dummy d9, VNIs 100-102, 200 group 239.1.1.1, 300 remote 2001:db8::1, 16777214-16777215); `brmaster` (a port named `master`). Every device has a fixed MAC and `addrgenmode none` before up. **Setup lessons:** MST can be enabled only while no port has VLANs (EBUSY, "MST mode can't be changed while VLANs exist"), so `brmst` sets it when br0 is made. A `tunnel_info` for a VLAN not yet on the port is a bare EINVAL with no extack (K2), so the VLAN is added first. `ip` reads a bare `master` as its keyword, so `brmaster` uses `name master`/`dev master`. **Options:** `-c` is `-color` (matched before `-compressvlans`) and compression is `-com`; the `-c vlan show` rows capture the ANSI colour, and under `-j` there is none. **Pinned by** `TestBridgeSpace`: 31 outcome rows (positive, negative, boundary and corner, each with description and expected), 6 fixture-order rows, a plain/`-j` pairing check, an addrgenmode-before-up check over every step, the row count, and a determinism check. **Live outcomes:** all 113 rows match their expected rc. Unknown option, unknown object and `help` exit 255 before any request. Unknown sub-commands, `vni sh` (strcmp), `vlan global sh` (B21), `vlan help`, `link show dev` (incomplete), duparg on `dev`/`vid`, and B1 are ack-then-fail, rc 255. nodev on each object's filter is kernel ENODEV from `ll_link_get`, rc 255. `vni show dev d1` is kernel EINVAL with extack "The device is not a vxlan device", rc 1, and prints "Dump ternminated" (B3). `vlan show dev if999` is rc 0 with the kernel's ENODEV ignored (B24). B10: with MST off, `mst show` prints its header and "Dump terminated", rc 255 (`-j` prints `[]`). On `brmstnov`, `mst show dev d1` prints d1's entry before aborting on d2. **JSON:** every `-j` stdout parses. `-j -s vlan show` keys VLANs `"vid"` where the other shows use `"vlan"` (B25), and compressed ranges print `"flags": []` (B26). **Corpus test:** a failed dump's extack comes in NLMSG_DONE (the int error, then TLVs, with no echoed request), which `wsObserve` did not read. `wsDoneExtack` now reads it, pinned by `TestWsDoneExtack` (8 rows). `go test ./pkg/xtcpnl/ -run Ws` passes over the new corpus. **Determinism:** batches A and B ran back to back on one boot of the shared workbench VM (113/113 OK each). Batch B is committed: 113 row dirs, 360 KB. `ip.rc`, `ip.err` and `ip.out` are identical on all 113 rows, and so are message types and flags. Bodies differ only in RTM_NEWLINK (IFF_RUNNING and IFLA_OPERSTATE from linkwatch timing, in `ll_init_map`'s AF_UNSPEC dump, which bridge never prints; IFLA_BRPORT_FORWARD_DELAY_TIMER, a live timer) and in the NLMSG_ERROR of the nodev rows, which echoes iproute2's time-based seq. **Not yet done at the time:** the fresh-boot batch. Another session had the VM up and in use, so it was not rebooted under them. **Fresh boots (done 2026-12-04, V402):** two batches, one on the 23:58 fresh boot once settled and one on a second fresh boot, both agreeing with the corpus in full, all differences this row's named classes — the `IFLA_BRPORT_FORWARD_DELAY_TIMER` bytes and the nodev NLMSG_ERRORs' echoed time-based seq (the A-vs-B list above holds boot to boot). | | V098 | 6P | **Table:** `pkg/xtcpnl/xtcpnl_attrtable.go` `AttrTable` is `parse_rtattr_flags`'s `tb[]`: types 0..max, first occurrence wins, `NLA_F_NESTED` masked, larger types dropped. `Has`, `Bytes` and the width-checked `U8`/`U16`/`U32`/`U64`/`Str` stand for `tb[X]` and `rta_getattr_*`; a getter's ok is false where iproute2 would read past the attribute (class C3). `TestAttrTable`: 15 rows. **Decoders:** `ParseBridgeLink` (`xtcpnl_bridge_link.go`) takes the ifinfomsg, the top-level table, PROTINFO as a nested `IFLA_BRPORT_*` table when it has `NLA_F_NESTED` (else the bare u8 state `print_protinfo` reads), and AF_SPEC: its table (MODE, FLAGS), the VLAN list in wire order with ranges unpaired, the tunnel nests, and the MST entries (first `IFLA_BRIDGE_MST` wins). `ParseTunnelMsg` (`xtcpnl_vnifilter.go`) takes tunnel_msg and each `VXLAN_VNIFILTER_ENTRY` as a table, with its STATS nest. `ParseBrVlanTables` (`xtcpnl_brvlan.go`) gives each RTM_NEWVLAN entry and global-options nest as a table, plus an entry's STATS nest. Every malformed stream is an error at any level, and so is a short `IFLA_BRIDGE_VLAN_INFO`, which bridge casts unchecked (B27, `vlan.c:1295`). **Builders:** `BuildDumpBrVlanRequest(flags)` (RTM_GETVLAN + `BRIDGE_VLANDB_DUMP_FLAGS`, always present) and `BuildDumpTunnelRequest(ifindex, flags)`. Link dumps reuse `BuildDumpLinkRequestExt` with the new `RtextFilterBrvlan`/`BrvlanCompressed`/`Mst` masks; stats reuse `BuildDumpStatsRequest`; lookups reuse `BuildGetLinkByNameRequest`. **Tests:** `TestParseBridgeLink` has 17 rows. Positive, from the corpus: d2's protinfo (cost 7, priority 5, learning off, hairpin on), d1's VLAN list, the `-com` range pair, vx0's tunnel map, d1's MST entries, and K1 (br0's own entry names itself as master). Negative: a short body, a truncated attribute, a 2-byte VLAN_INFO, a truncated nest. Boundary: vid 1 and 4094, an empty AF_SPEC, B10's reply with no AF_SPEC. Corner: legacy u8 PROTINFO, an unknown `IFLA_BRIDGE_*`, MST twice, a negative ifindex. `TestParseTunnelMsg` has 9 rows (vnif's entries and stats; short, truncated, a truncated entry; empty and vni 16777215; a skipped non-ENTRY; a v6 group). `TestParseBrVlanTables` has 7 rows (`-d`, `-s -d` and global replies; short, truncated; empty; a skipped type). Fuzzers `FuzzParseBridgeLink`, `FuzzParseTunnelMsg` and `FuzzParseBrVlanTables` are seeded from the corpus; 20 s each found nothing. Benchmarks: `BenchmarkParseBridgeLink`, `BenchmarkParseTunnelMsg`, `BenchmarkParseBrVlanTables`. Coverage of the new code is 84-100% per function. **O3/O4** (`xtcpnl_ws_bridge_test.go`): `TestBridgeParseCmd` (25 rows) models `main`'s options (`-c` is colour, `-com` compression), `do_cmd`'s prefix dispatch (`m` is mdb), each object's sub-command dispatch (matches or strcmp), and the show loops (dev and master not else-if, vid via atoi, unknown words ignored). `TestWsBridgeCorpus` rebuilds every request each row sent, byte for byte with seq aside: `ll_init_map`'s AF_UNSPEC dump (mask 0x109); a by-name RTM_GETLINK for each filter name missing from that dump, its answer deciding nodev, or `ifN` (B24); then the object's request(s). It decodes every object reply and checks each `-j` output against them: link (filters, master names, mtu), vlan (ranges), tunnelshow, mst, vni, global, and `-s vlan show` (pure port entries skipped; VLANs keyed `"vid"`, B25). The counts are pinned at 214 requests, 5 lookups, 213 replies and 41 JSON outputs. **Universe:** RTM_GETTUNNEL was an exclusion ("bridge only"); it is captured now, so the exclusion is gone. Gates: `go test ./pkg/xtcpnl/`, vet, gofmt, `lint-baseline` (tiers 0-2 clean), `netlink-audit`, `kernel-citation-audit`. | | V099 | 6R | **Clone:** `internal/gobridge` follows bridge/*.c function by function. `gobridge.go`: main's option loop (`matches`, `-c` colour before `-com`, the unknown-option text), `do_cmd`'s prefix dispatch, the usages, `atoi`, and the show-argument loops. `link.go`: `brlink_show` with B1's missing else, `print_linkinfo`, `print_link_flags`, `print_name_and_link`, `print_protinfo` (`-d`, `-o`), `print_af_spec`. `vlan.go`: `vlan_show`'s three paths (BRVLAN/COMPRESSED link dump, the RTM_GETVLAN `-d` dump, the two `-s` stats dumps, tunnelshow included, B22), `print_vlan_info`, `print_vlan_tunnel_info`, `print_vlan_rtm`/`_opts`/`_global_opts` with querier state and router ports, and `print_vlan_stats_attr` (pure port entries skipped). `vni.go`: `vni_show` ("Dump ternminated"), `print_vni` with glibc's `inet_ntop` text, `print_vnifilter_entry_stats`. `mst.go`: `mst_show` (return -1, B4), `print_msts` (B10's early -1), `print_mst_entry` (B11). `print.go` is json_print/json_writer/color.c: callers format the text as the C format would and pass the JSON token, which keeps each print's width and sign (B12: mtu is signed JSON, unsigned text). `rtnl.go` is `rtnl_dump_filter` (DONE's extack whatever the flags, ENOENT/EOPNOTSUPP silent, EMSGSIZE, perror), `rtnl_dump_error`, the suppressed `ll_link_get` (by name or index), `ll_name_to_index` with the `ifN` fallback (B24), and `ll_index_to_name`. Raw-type reads use three new xtcpnl helpers, because `print_vlan` (`parse_rtattr`, no mask) and `print_msts` (`parse_rtattr_one(NLA_F_NESTED|IFLA_BRIDGE_MST)`) depend on the flag bits: `ParseAttrTableFlags`, `WalkRawAttrs` and `FindRawAttr`, pinned by `TestAttrTableRaw` (8 rows). **Divergences, by design:** a NULL read bridge makes (B18, B19, B20) is exit 139 with stdout lost, as bridge dies. An attribute bridge reads past (B8, B9, B23, B27) is refused with a message naming the lead, rc 1, since the bytes past it are not in the reply. `-s` with multicast router ports (`br_print_router_port_stats`), `-netns`, `-batch` and every write are not implemented (rc 255). **Sources:** `ReplaySource` (the `wsreplay` core) and `LiveSource` (one NETLINK_ROUTE socket with `NETLINK_EXT_ACK`, read until DONE/ERROR or a get's one reply). **Tests:** `TestGobridgeCorpus` replays all 113 rows. stdout, stderr and rc match bridge's and no request is left unasked; the 45 `-j` outputs are valid JSON. A check that the test bites: fixing the "ternminated" typo fails 1 row, and a space in the stats header fails 3. `TestGobridgeUnit` has 41 rows over a scripted source. Positive: `-com` ranges, `-j link show`, hwmode, IFLA_LINK peers, `-o`, `-j -p`, querier state and router ports. Negative: unknown object, nodev, a refused write, an NLMSG_ERROR mid-dump, B4, an exhausted script, link help, B27. Boundary: empty dumps, `[]`, vid 4094, IFLA_LINK 0, the DONE errnos. Corner: `vni sh`, B1, `vid abc`, B10, B11, B13 (state and hwmode), B12, B7, B15, B16, B18, B19, B20, colour (dark palette) and none under `-j`, B22, B3, and an uncached master looked up by index. `TestHelpers` has 22 rows (`atoi` wrap, `ifN`, negative padding widths, glibc IPv6 text, `%#llx` of 0, `print_time64`, s64 wrap, COLORFGBG, `check_ifname`). `TestGobridgeImports` mirrors gotipc's guard and adds `pkg/cint`. Coverage is 80.8%; the live socket is the main gap. **Mutants** (each under `systemd-run --user --scope -p MemoryMax=6G`, `go test -timeout=180s`) were killed: drop range compression, swap PVID/Untagged, skip the vni header, drop `RTEXT_FILTER_MST`, fix B1 with else-if, mst failure exit 1 (fix B4), stats key `"vlan"` (fix B25), drop the `ifN` fallback. One survived and is equivalent: colour left on under `-j`, which can never print, since colour applies only to text. **Package:** `nix build .#gobridge` builds; its binary, with `GOBRIDGE_REPLAY`, reproduces ec-038 (`-com vlan show`), pw-042 (`-j -s vni show`) and ng-020 (B10) byte for byte. **Left:** the live run beside `bridge` in a VM netns, which waits for the shared VM. Gates: `go test ./internal/gobridge/ ./pkg/xtcpnl/`, vet, gofmt, `lint-baseline` (tiers 0-2 clean), `netlink-audit`, `kernel-citation-audit`, deadnix, statix, nix-fmt. | | DOC032 | 6B | **Doc:** `docs/netlink/upstream/iproute2-bridge-print-paths.md`, marked "Not submitted to netdev". It records 26 iproute2 findings (B1-B13, B15, B16, B18-B27) and kernel notes K1 and K2, each with its class from `bug-classes.md`, file:line in the local `87cb3f41`, what happens, and the corpus row or unit row that shows it. Reachable on a stock kernel and in the corpus: B1 (a port named `master` cannot be filtered; one spelling prints nothing with rc 0), B2, B3 ("Dump ternminated", via `vni show dev d1`), B5, B6, B10 (`mst show` with MST off fails, rc 255), B21, B22, B24, B25, B26. Latent, with unit rows: B4, B7, B8, B9, B11, B12, B13, B15, B16, B18-B20 (NULL reads; B18 is a copy-paste guard), B23, B27. B14 is dropped: `-com vlan show vid 22` printing `20-25` is a fair answer. **Upstream check:** `git log v7.2.0..87cb3f41 -- bridge/ lib/bridge.c` is empty. git.kernel.org refused a fetch (403), so upstream's `bridge/` log was read from the GitHub mirrors (`iproute2/iproute2`, `shemminger/iproute2`) with `gh api`. Their newest `bridge/` commit, `66d16c41` (2026-06-28), is in `v7.2.0`, so every finding is still present. Line numbers and the kernel claims (MLD_VERSION sent only with `CONFIG_IPV6`, `br_vlan_options.c:459`) were re-checked against the trees. | @@ -136,9 +138,10 @@ | V105 | 7S | **Builders:** `pkg/xtcpnl/xtcpnl_bridge_fdbmdb_requests.go`. `BuildFdbDumpRequest(ifindex, master, seq)` is fdb_show's strict dump (an AF_BRIDGE ndmsg with the `dev` index in `ndm_ifindex`, `NDA_MASTER` for `br`); `BuildFdbGetRequest(FdbGet)` is fdb_get's (NLM_F_REQUEST alone, `NDA_LLADDR`, `NDA_VLAN`, `NDA_VNI`, `NDA_MASTER` in that order); `BuildMdbDumpRequest` is `rtnl_mdbdump_req(PF_BRIDGE)`; `BuildMdbGetRequest(MdbGet)` is mdb_get's (`MDBA_GET_ENTRY`, a 28-byte `br_mdb_entry` from `MarshalMdbGetEntry`, then `MDBA_GET_ENTRY_ATTRS` with NLA_F_NESTED set by hand around SOURCE and SRC_VNI), with new constants `MdbaGetEntry`/`MdbaGetEntryAttrs` and three length errors. **Tests:** `TestFdbMdbBuilders`, 16 rows (positive: fdb dump unfiltered, `dev`, `br`; mdb dump; fdb get with vlan/vni/br and with `dev ... self`; mdb get with and without a source. Negative: a 5-byte MAC, a 5-byte group, a 6-byte source. Boundary: vlan unset, vlan 0 sent, an IPv6 group and source. Corner: an L2 group (proto 0), `src_vni` alone). `TestFdbMdbReadbackRequests` rebuilds every dump request in the 7_3_0 readbacks (fdbbr 99, fdbvx 100, mdbbr 90, mdbvx 87 rows; 199 fdb and 2×177 mdb requests) byte for byte, seq and pid aside. `TestFdbDumpDatagramPadding`, 2 rows: bridge sends the fdb dump as `sizeof(req)`, a 284-byte datagram whose message is 28 bytes and the rest zero, while the mdb dump's datagram is its 24 bytes; replay matches on `nlmsg_len`, so the 28 bytes are what gobridge sends. `internal/gobridge/readback_test.go`, `TestGobridgeReadbacks`: finds every row with a `netlink_route_dump.pcap`, checks its one readback is `bridge fdb|mdb show`, and pins the counts (376); it replays each against `dump.out` once 7R sets `readbacksLive`. **Source check:** `git diff v7.2.0 87cb3f41 -- bridge/fdb.c bridge/mdb.c bridge/bridge.c` is empty; `lib/json_print.c`, `json_writer.c`, `libnetlink.c`, `ll_addr.c` and `utils.c` moved, so 7B reads those at both. Gates: `go test ./pkg/xtcpnl/ ./internal/gobridge/`, vet, gofmt. | | V106 | 7P | **Parsers:** `pkg/xtcpnl/xtcpnl_bridge_fdbmdb_parse.go`. `ParseMdbDumpRouters(body)` is one mdb dump reply whole: `MdbDump{Bridge, Entries, Routers, HasRouter}`, the entries `ParseMdbDump`'s and `MDBA_ROUTER` through `ParseMdbRouterPorts`. `ParseMdbGetReply(body)` is mdb_get's answer: exactly one entry and no `MDBA_ROUTER`, else `ErrMdbGetReply`. `xtcpnl_mdb.go`: `MdbAttrs.SrcTimers`, parallel to `SrcList` (`MDBA_MDB_SRCATTR_TIMER`, new `MdbSrcAttrTimer`; dump only, 0 for a source without one), the first address of a source entry winning. `xtcpnl_ndmsg.go`: `NeighInfo.LinkNetnsid`/`HasLinkNetnsid` (`NDA_LINK_NETNSID` as the kernel's s32, so 0xffffffff is -1), and `NtfSticky`, which x/sys/unix lacks. **Tests:** `TestParseMdbDumpRouters` 13 rows (positive: entries then router ports, a source list with its timers, router ports alone; negative: a router port shorter than its ifindex, an entry info one byte short of `br_mdb_entry`, a header shorter than `br_port_msg`; boundary: an empty `MDBA_ROUTER` is present with no ports, an empty `MDBA_MDB`, a bare `br_port_msg`; corner: two `MDBA_ROUTER` nests append in order, a source without a timer reads 0, a second address in one source entry is ignored, an unknown top-level type is skipped). `TestParseMdbGetReply` 9 rows (an S,G entry; no entry; two; router ports beside it; a 27-byte entry info; an attribute longer than the body; a 3-byte tail, nothing found; an L2 group; two `MDBA_MDB` nests are two entries). `TestParseNeigh` gains three `LINK_NETNSID` rows (1; 0xffffffff is -1; 3 bytes, absent) and its unknown-type row moves to type 40, past `NDA_MAX`. `TestParseMdbDump`'s VXLAN row carries a timer. `TestFdbMdbReadbackReplies` decodes every reply in the 376 readbacks: fdbbr 535 and fdbvx 22 AF_BRIDGE neighbors, 756 and 34 mdb entries, each with as many timers as sources, and K5 holds: the bridge's 360 mdb replies are RTM_GETMDB, the VXLAN's 174 RTM_NEWMDB. `FuzzParseMdbDumpRouters` (20 s, no failure; an error returns no partial dump); `BenchmarkParseMdbDumpRouters` 653 ns, 7 allocs. **Not done as planned:** no separate `ParseFdb`. `ParseNeigh` already decodes every fdb attribute with presence bits, so the one missing (`LINK_NETNSID`) went there, and gobridge renders from raw tables anyway (6P). Gates: `go test ./...` (the full suite), vet, gofmt, `kernel-citation-audit`. | | V107 | 7R | **Clone:** `internal/gobridge/fdb.go` is fdb.c's reads. `do_fdb` (sub-commands by prefix, `flush` by strcmp, `fdb g` is get); `fdb_show` (strcmp'd words, a prefix of `help` prints the usage, any other word ignored; `br` resolved before `dev`; "Cannot find bridge device" returns -1; the request is `BuildFdbDumpRequest`); `state_a2n` (prefixes, `s` is static, `all`, strtoul base 0); `print_fdb` in bridge's order (mac, `dev` only when no dev filter, dst, vlan, port as be16, vni, src_vni, `via` keyed `viaIfIndex` with `NDA_LINK_NETNSID` and `viaIf` without, nhid, link-netnsid signed in text and unsigned in JSON, the `-d` ext attrs, `-s` `used %d/%d` at user HZ 100, the flags array always present in JSON, master, then the state with a hard newline that ignores `-o`; REACHABLE prints `""`, an unknown state `state=0x..`); `ll_addr_n2a` with the cached ARPHRD type (a tunnel's address as an IP); `fdb_get` (vlan is a short from atoi, so 65535 is unset and 70000 is 4464; duparg2 before NEXT_ARG; vni over 24 bits is "invalid VNI\n" plus invarg's newline; sscanf `%hhx` MACs; a failed talk returns -2 with the extack only under `NLM_F_ACK_TLVS`, else "RTNETLINK answers"; "An error :-)"). `mdb.go` is mdb.c's: `do_mdb` (`get`, `replace` and `flush` strcmp'd, so `mdb g` is unknown); `mdb_show`'s two dumps into `[{"mdb":[...],"router":{...}}]` (unknown words and `help` ignored; a failed dump returns -1 in text, and under `-j` is the `jsonw_destroy` assert, rc 134 with stdout lost, `errAbort`); `print_mdb_entry` (JSON `index`, dev, port, grp, src, state, `-d` filter mode, source list with unaligned `%lu.%.2lu` timers and proto by the rtprot table, flags, vid, dst, dst_port, vni, src_vni, via, `-s` aligned timer; an L2 group's src is `(null)` in text and a bare key in JSON); router ports only under `-d` for a bridge (GETMDB), a VXLAN's as `router port dev X master Y`; `mdb_get` (exact `help`, the required-argument message, nodev, then the group by `inet_pton` v4, v6, then `ll_addr_a2n`, which must return 6: a dotted form is `get_addr_1(AF_INET)`, 4 bytes on success and so silently invalid, and each `:`-cut part is sscanf `%x` into an int, a bad part named alone in "is invalid lladdr."; the reply printed by `print_mdbs` as a flat array). `runner` gains the fdb and mdb statics (`fdbIndex`, `fdbMaster`, `fdbState` ORed, `fdbVlan`, `fdbDynamic`, `mdbIndex`, `mdbVlan`), never reset (F2, M3). `rtnl.go`'s link cache keeps `ifi_type`. **Found by the 7C corpus:** the first `mdbParseGrp` printed "is invalid lladdr." for `grp bogus`; bridge prints only "Invalid address", because sscanf `%x` reads `b` and `ll_addr_a2n` returns 1. It now follows `ll_addr_a2n` as written. **Tests:** `TestGobridgeReadbacks` replays all 376 readbacks against `dump.out` (fdbbr 99, fdbvx 100, mdbbr 90, mdbvx 87). `TestGobridgeFdbMdbUnit` 47 rows (positive 10: a bridge entry, `-j` with `flags:[]`, `-s` used 2/5, `-d` activity_notify and inactive, a vxlan entry's dst/port/vni/src_vni/via/nhid, `fdb get`, `-d mdb` source list and proto, `-d` router ports, `-j mdb get` as a flat array, a VXLAN's router line; negative 18: unknown fdb command, `mdb g`, nodev with no dump sent, `br nosuch`, the fdb dump error with `[` left open (F12), the mdb dump error in text (rc 255) and under `-j` (rc 134), `fdb get` ENOENT with its extack (rc 254), a bad MAC, two addresses, `vni 16777216`, `state bogus`, `mdb get` without a group, and six bad groups through `ll_addr_a2n`; boundary 7: empty dumps in text and JSON, `[{"mdb":[],"router":{}}]`, `state 0`, `LINK_NETNSID` -1 in text and JSON, seven MAC parts; corner 12: the reachable trailing space, an unknown state, `dynamic` keeping NOARP, the dev column hidden by `dev`, an L2 group's src in text and JSON, router type 0 printing permanent, `mdb show bogus help`, `vid` filtering in userspace, `fdb g` with get's dev column kept, an empty and a negative MAC part). Coverage 80.5% at this commit, 83.2% once the 7C corpus replays too (V108; 6X-R's was 82.9%). **Mutants** (each under `systemd-run --user --scope -p MemoryMax=6G`, `go test -timeout=180s`), 10 of 10 killed: the reachable `""` dropped; `-o` honoured in fdb; the statics reset per line; `mdb get` by prefix; `NDA_MASTER` dropped; aligned source-list timers; `dynamic` dropping NOARP; the via key fixed; router ports without `-d`; the mdb dump error as exit 1. **Docs:** the package doc, `errNotImplemented` and gobridge.md's refusal list now name only the writes and `monitor`. Gates: `go test ./internal/gobridge/` (also in a clean worktree of the commit), vet, gofmt, `CGO_ENABLED=0 go build ./...`, `nix build .#gobridge`, `lint-baseline` (its first run found 17: `printFdb`, `fdbGet` and `printMdbEntry` too complex and `mdbGet` too long, now split into `fdbExtVlan`, `fdbHead`, `fdbRemote`, `fdbCacheInfo`, `fdbMasterName`, `fdbGetParse`, `mdbRemote` and `mdbGetParse`; the shared words `dev`, `vni`, `src_vni` and `permanent` made constants; a tagged switch; a spelling; the mutants were rerun after, 10 of 10 killed), `netlink-audit`, `kernel-citation-audit`. | -| V108 | 7C | **Spaces:** `tools/nlcapgen/matrix_bridgefdb.go` and `matrix_bridgemdb.go`, families `bridgefdb` and `bridgemdb` (rows `nix/microvms/workbench/bridge{fdb,mdb}.rows.jsonl`, corpus `pkg/xtcpnl/testdata/7_3_1/ws/bridge{fdb,mdb}/`, 3.5 MB). Their own fixed-MAC fixtures, not the 7_3_0 `fdbBrSetup`/`mdbBrSetup`, whose MACs are random. **fdb, 94 rows:** 37 commands plain and `-j` plus 20 negatives over `fdb` (br0, d1 and d2 on vid 10; 0a:01 static vid 10, 0a:02 permanent, 0a:03 dynamic, 0a:04 sticky, 0a:05 extern_learn, 0a:06 activity_notify, 0a:07 `self` on d1) and `fdbvx` (vx0 with `dst port vni src_vni via` and a `nexthop ... fdb` group used by `nhid 1`): `show` bare, `-s`, `-d`, `-o`, `br`, `brport`, `dev`, `br`+`dev`, `vlan`, every `state` form (`permanent`, `static`, `reachable`, `all`, `0`, `s`), `dynamic`, `dev d1 dev d2`, `vlan 0 vlan 10`, `bogus`, `sh`; `get` by `br`+`vlan`, by `dev`, `g`, `to`, `-s -d`, `dynamic`; and five batches (dev, br, state ORed, get's `dynamic` reaching show, `vlan` reaching get). **mdb, 74 rows:** 29 commands plain and `-j` plus 16 negatives over `mdb` (br0 snooping IGMPv3/MLDv2, IPv6 off on br0; 239.1.1.1 vid 10, ff0e::1 temp, *,G 239.2.2.2 include with two sources and proto static, S,G 232.1.1.1, an L2 group, a host join, d1 a permanent router port) and `mdbvx` (vx0 with three remote entries): `show` with `-d`, `-s`, `-d -s`, `-o -d`, `-o -d -s`, `dev br0`, `dev d1`, `vid 10`, `vid abc`, `bogus`, `help`, `sh`; `get` of each group kind; three batches. **Two batches** on one workbench boot (kernel 7.3.1, iproute2 7.2.0; the VM is shared, so not rebooted): fdb 94/94 and 94/94, stdout, stderr, rc and `b.txt` identical; mdb 74/74 and 74/74, identical but for the running timer of the temp entries in four `-s` rows (ec-005, ec-006, ec-008, pw-005), the named allow-list. **Found while capturing** (each fixed in the space, its row kept): (1) the kernel refuses `permanent` for a host join, so the first mdb batch lost 56 rows to a failed pre step; the host join is `temp`. (2) An entry added without a vid on a VLAN-filtering bridge is installed on every VLAN of the port (1 and 10), and `mdb get` without `vid` looks up vid 0: ENOENT. The gets name `vid 10`, and ng-008 keeps the vid-less get as a negative. (3) A VXLAN mdb entry's `src_vni` is part of its key, yet the dump of a device that is not `external` never prints it: `mdb get ... grp 239.1.1.2` misses (ng-014, "vxlan: MDB entry not found") until `src_vni 300` is given (ec-025). (4) br0's own MLD report put an `ff02::6a` host join in the dump at a random moment; IPv6 is off on br0. The errno of ng-014 is spelled `ENOTSUP`, the corpus's name for 95. **Live, confirmed:** F2 (dev, br and state statics carry into the next batch line; a second `vlan`/`vid` line is a duparg, ng-020, mdb ng-016), F3 (`fdb show` after `dev d1` drops the dev column), F4 (`dynamic` keeps static and extern_learn entries), F5 (`state s` is static), F7 (extern_learn's REACHABLE state prints as a trailing space), F13 (`vlan 65535` is not sent, so the get misses; `vlan 70000` is sent as 4464, "invalid vlan id"; `vni 16777216` is "invalid VNI" plus an empty line), M1 (`mdb show bogus`, `help`), M2 (`mdb g` unknown), M3 (a stale `vid 1` hides get's vid 10 answer, ec-028), M5 (the L2 group), K4 (`fdb get br br0 dev d1`, "Master and device are mutually exclusive"). **Tests:** `TestBridgefdbSpace` and `TestBridgemdbSpace` (counts; route proto and bridge/vxlan modules; every read row paired with its `-j` twin; no write captured; batch rows read `b.txt`; generation deterministic; the nexthop before `nhid 1`; 25 and 19 rows pinning each row's kind, rc, refusal, errno, extack and pre count). `TestWsCorpusRows` passes all 168. `pkg/xtcpnl/xtcpnl_ws_bridgefdbmdb_test.go`: O3 `TestWsBridgeFdbMdbRequests` rebuilds all 69 fdb dumps, 22 fdb gets, 94 mdb dumps and 22 mdb gets with the 7S builders, byte for byte, seq and pid aside; O4 `TestWsBridgeFdbMdbJSON` checks the 37 fdb and 29 mdb `-j` rows with rc 0: each of the 643 and 228 objects is an entry a reply carried (by MAC or group), and each of the 4 router keys a bridge whose reply had `MDBA_ROUTER`. `TestGobridgeCorpus` replays all 344 `ws/bridge*` rows (113, 63, 94, 74) byte for byte with every request asked for, 7R's `mdbParseGrp` fix included (ng-011); coverage 83.2%. Gates: `go test ./...`, vet, gofmt, `lint-baseline`, `netlink-audit`, `kernel-citation-audit`. | +| V108 | 7C | **Spaces:** `tools/nlcapgen/matrix_bridgefdb.go` and `matrix_bridgemdb.go`, families `bridgefdb` and `bridgemdb` (rows `nix/microvms/workbench/bridge{fdb,mdb}.rows.jsonl`, corpus `pkg/xtcpnl/testdata/7_3_1/ws/bridge{fdb,mdb}/`, 3.5 MB). Their own fixed-MAC fixtures, not the 7_3_0 `fdbBrSetup`/`mdbBrSetup`, whose MACs are random. **fdb, 94 rows:** 37 commands plain and `-j` plus 20 negatives over `fdb` (br0, d1 and d2 on vid 10; 0a:01 static vid 10, 0a:02 permanent, 0a:03 dynamic, 0a:04 sticky, 0a:05 extern_learn, 0a:06 activity_notify, 0a:07 `self` on d1) and `fdbvx` (vx0 with `dst port vni src_vni via` and a `nexthop ... fdb` group used by `nhid 1`): `show` bare, `-s`, `-d`, `-o`, `br`, `brport`, `dev`, `br`+`dev`, `vlan`, every `state` form (`permanent`, `static`, `reachable`, `all`, `0`, `s`), `dynamic`, `dev d1 dev d2`, `vlan 0 vlan 10`, `bogus`, `sh`; `get` by `br`+`vlan`, by `dev`, `g`, `to`, `-s -d`, `dynamic`; and five batches (dev, br, state ORed, get's `dynamic` reaching show, `vlan` reaching get). **mdb, 74 rows:** 29 commands plain and `-j` plus 16 negatives over `mdb` (br0 snooping IGMPv3/MLDv2, IPv6 off on br0; 239.1.1.1 vid 10, ff0e::1 temp, *,G 239.2.2.2 include with two sources and proto static, S,G 232.1.1.1, an L2 group, a host join, d1 a permanent router port) and `mdbvx` (vx0 with three remote entries): `show` with `-d`, `-s`, `-d -s`, `-o -d`, `-o -d -s`, `dev br0`, `dev d1`, `vid 10`, `vid abc`, `bogus`, `help`, `sh`; `get` of each group kind; three batches. **Two batches** on one workbench boot (kernel 7.3.1, iproute2 7.2.0; the VM is shared, so not rebooted): fdb 94/94 and 94/94, stdout, stderr, rc and `b.txt` identical; mdb 74/74 and 74/74, identical but for the running timer of the temp entries in four `-s` rows (ec-005, ec-006, ec-008, pw-005), the named allow-list. **Found while capturing** (each fixed in the space, its row kept): (1) the kernel refuses `permanent` for a host join, so the first mdb batch lost 56 rows to a failed pre step; the host join is `temp`. (2) An entry added without a vid on a VLAN-filtering bridge is installed on every VLAN of the port (1 and 10), and `mdb get` without `vid` looks up vid 0: ENOENT. The gets name `vid 10`, and ng-008 keeps the vid-less get as a negative. (3) A VXLAN mdb entry's `src_vni` is part of its key, yet the dump of a device that is not `external` never prints it: `mdb get ... grp 239.1.1.2` misses (ng-014, "vxlan: MDB entry not found") until `src_vni 300` is given (ec-025). (4) br0's own MLD report put an `ff02::6a` host join in the dump at a random moment; IPv6 is off on br0. The errno of ng-014 is spelled `ENOTSUP`, the corpus's name for 95. **Live, confirmed:** F2 (dev, br and state statics carry into the next batch line; a second `vlan`/`vid` line is a duparg, ng-020, mdb ng-016), F3 (`fdb show` after `dev d1` drops the dev column), F4 (`dynamic` keeps static and extern_learn entries), F5 (`state s` is static), F7 (extern_learn's REACHABLE state prints as a trailing space), F13 (`vlan 65535` is not sent, so the get misses; `vlan 70000` is sent as 4464, "invalid vlan id"; `vni 16777216` is "invalid VNI" plus an empty line), M1 (`mdb show bogus`, `help`), M2 (`mdb g` unknown), M3 (a stale `vid 1` hides get's vid 10 answer, ec-028), M5 (the L2 group), K4 (`fdb get br br0 dev d1`, "Master and device are mutually exclusive"). **Tests:** `TestBridgefdbSpace` and `TestBridgemdbSpace` (counts; route proto and bridge/vxlan modules; every read row paired with its `-j` twin; no write captured; batch rows read `b.txt`; generation deterministic; the nexthop before `nhid 1`; 25 and 19 rows pinning each row's kind, rc, refusal, errno, extack and pre count). `TestWsCorpusRows` passes all 168. `pkg/xtcpnl/xtcpnl_ws_bridgefdbmdb_test.go`: O3 `TestWsBridgeFdbMdbRequests` rebuilds all 69 fdb dumps, 22 fdb gets, 94 mdb dumps and 22 mdb gets with the 7S builders, byte for byte, seq and pid aside; O4 `TestWsBridgeFdbMdbJSON` checks the 37 fdb and 29 mdb `-j` rows with rc 0: each of the 643 and 228 objects is an entry a reply carried (by MAC or group), and each of the 4 router keys a bridge whose reply had `MDBA_ROUTER`. `TestGobridgeCorpus` replays all 344 `ws/bridge*` rows (113, 63, 94, 74) byte for byte with every request asked for, 7R's `mdbParseGrp` fix included (ng-011); coverage 83.2%. Gates: `go test ./...`, vet, gofmt, `lint-baseline`, `netlink-audit`, `kernel-citation-audit`. **Amendment (2026-12-04):** the 7C gate's "if the shared VM is free, two fresh-boot batches for both 6C and 7C" is met — both fresh boots ran `bridgefdb` and `bridgemdb` too, 94/94 and 74/74 each, the diffs the same timer rows this row names (plus their `-j -s` and `-s -o` variants, pw-006/pw-008) — see V402. | | DOC034 | 7B | **Doc:** [upstream/iproute2-bridge-print-paths.md](upstream/iproute2-bridge-print-paths.md) gains a section "Increment 7: fdb and mdb", still "Not submitted to netdev". The plan's 25 leads (F1-F14, M1-M11) were read against `bridge/fdb.c`, `bridge/mdb.c` and the `lib/` helpers at `v7.2.0`, and against the kernel (v7.4-rc4). A lead-to-B table maps the lead names that gobridge's unit rows and overread refusals use. **Recorded:** B38 (`fdb show dev d1 dev d2` silently shows d2; mdb's `dev` has a duparg), B39 (fdb's five and mdb's two filter statics carry between batch lines; new: a show's `vlan`/`vid` hides a later get's answer, rc 0, fdb ec-037 and mdb ec-028), B40 (`dynamic` keeps NOARP entries), B41 (`state s`, `state 0`, `state all`), B42 (`viaIfIndex`/`viaIf`; the s32 netnsid as `%d` and unsigned), B43 (REACHABLE prints `""` and a trailing space), B44 (fdb reads unchecked; cacheinfo `%d`), B45 (`-o` ignored by fdb and mdb's `-s` router lines), B46 (fdb dump error exit 1, `[` open), B47 (`fdb get`: "invalid VNI\n" plus invarg's newline, vlan atoi into a short, duparg2 before NEXT_ARG names the keyword, a dead `dev` branch, `to` named for a word never typed), B48 ("An error :-)"), B49 (unknown words in `mdb show`, `mdb get`, `fdb show`), B50 (`mdb g` vs `fdb g`), B51 (a failed mdb dump under `-j` trips `jsonw_destroy`'s assert, SIGABRT), B52 (an L2 group's `src`: `(null)`, a bare JSON key; the object left open on `!addr`), B53 (mdb casts unchecked), B54 (router type 0 prints "permanent"), B55 (`mdb get vid` atoi into a short; `src_vni` without a 24-bit check, truncated by `addattr32`), B56 (two mdb JSON shapes; router ports keyed by bridge name), B57 (`ll_addr_a2n` at 7.2.0: `bogus` and seven parts silent, a message naming one part). Kernel: K4 (`fdb get br dev` "mutually exclusive" though the usage offers both), K5 (bridge vs vxlan mdb dump types), K6 (strict mdb dump rejects an ifindex), K7 (a vxlan `src_vni` is kept in the key, never dumped, and needed by get), K8 (host joins refuse flags), K9 (a vid-less get misses entries installed per VLAN). M11 (`brifname` in `ll_index_to_name`'s static buffer) is dropped: it needs two uncached indexes. The assert abort is C6 with C12, so no new class. **Newest code:** `git log v7.2.0..87cb3f41 -- bridge/` is empty, and the GitHub mirror's newest `fdb.c`/`mdb.c` commit, `b468824a`, is in `v7.2.0`. `lib/json_writer.c`'s `c4c9a7fa` keeps the assert (line 122). The `libnetlink.c` commits since don't touch error printing. `ll_addr.c`'s `5faf18f6` fixes B57 at HEAD. Line numbers were re-read from `git show v7.2.0:bridge/{fdb,mdb}.c`, and each cited row's cmd, rc and output from the corpus. Gates: `kernel-citation-audit`. | | V109 | 7L | **Live diff:** on the running workbench VM (kernel 7.3.1, iproute2 7.2.0; no reboot, the VM being shared and idle), the nix-built `gobridge` (`/nix/store/wf30i2nr…-gobridge-0.2.1`, built from `59c54f599`) beside `bridge`, as root over the workbench's ssh key. The script is generated from the corpus: each distinct 7C fixture (the `pre` steps of `cmd.json`) is set up in its own named namespace (`gb7f0`-`gb7f4`: empty, `fdb`, `fdbvx`, `mdb`, `mdbvx`), and every one of the 168 `ws/bridgefdb` and `ws/bridgemdb` commands runs there under both tools, batch rows with their `b.txt`. To those, 6 forms from the root namespace: `-netns X fdb show`, `-n X -j fdb show br br0`, `-n X -d mdb show`, `-n X -j -d mdb show`, `-n X -j mdb get dev vx0 grp 239.1.1.2 src_vni 300`, and a `-n X -batch` mixing `fdb show dev d1`, `fdb get` and `mdb show`. stdout, stderr and rc were compared. **Result:** 169 of 174 identical. The other 5 (mdb ec-006, ec-008, pw-005, pw-006, pw-008, all `-s`) differ only in the running timer of the temp entries (`257.04` against `257.03`), read about 10 ms apart; a rerun of the six mdb `-s` rows with `[0-9]+.[0-9]{2}` masked was 6 of 6 identical. This is the same allow-list as 7C's two batches. No divergence, so no fix and no new unit row. The namespaces and work directory are removed after the run. | +| V402 | 6C | **Fresh-boot batches — the 6C gate's last task (and 7C's conditional).** Two batches, each on its own fresh boot of the workbench VM (kernel 7.3.1, iproute2 7.2.0; `nlcap-ws down` then `up`, the guest's `is-system-running` running before the first row), each running all four `ws/bridge*` row files through `nlcap-ws batch`, the committed corpus untouched. **Boot 1:** the batch the boot's own start rejected, re-run once the boot settled — 113 (`bridge`), 63 (`bridgex`), 94 (`bridgefdb`), 74 (`bridgemdb`), 344 of 344 OK. **Boot 2:** a second down+up — 344 of 344. **`nlcapgen verdiff` against the corpus:** `bridge` 0 differences (113 rows), `bridgex` 6 (the `brrtr -s` timer rows ec-021/022/023, pw-021/022/023, V101's allow-list), `bridgefdb` 0 (94), `bridgemdb` 6 (the temp-entry timer rows ec-005/006/008, pw-005/006/008 — V108's rows and their `-j -s`/`-s -o` twins). Boot 1 against boot 2 directly: the same profile, 0/6/0/6, the same rows. **A body-level pass** (a throwaway `tmp-bodydiff`, deleted; the corpus vs each boot's pcaps, message by message, seq and pid zeroed): every differing message is one of V097's two named classes — the `br` fixture's link replies at `IFLA_BRPORT_FORWARD_DELAY_TIMER` (offsets 360/364 of the 420-488-byte messages, 33 rows), and the NLMSG_ERROR bodies' echoed request seq (offsets 24, 28-30 and 60 in the 40-, 72- and 96-byte error shapes; `0x6b03d2bc` against `0x6b129194`, minutes apart; 28 rows). 58 rows (boot 1) and 61 rows (boot 2) differ in any body at all; every other byte of every other message is identical. The stats counters and the vxlan random source port, the 6C gate's own expected exceptions, never moved. **The first fresh-boot attempt failed 34 of 113 rows:** the batch fired 24 s after qemu started, `up` returning at ssh and the guest's systemd still settling, and the first wave's rows crosstalked at their ns lifecycle ("Cannot open network namespace" immediately after `NLCAP_NS_OK wsN"; "Cannot create namespace file: File exists" after ns-add's own cleanup; ec-010's pre step 0 creating br0 and pre step 1 finding it gone; "Cannot find device nlmon0"; `NLCAP_CAP_NOBIND`, datagrams=0). The mechanism was not pinned down; the wait is measured. A batch the same boot ran two hours later was 113 of 113, and a concurrent session's batch on the same boot (a `brmonitor` corpus, 44 rows, all OK) confirms the settled guest. `xtcp2-nlcap-ws up` now waits for `is-system-running` (running or degraded) before `NLCAP_WS_UP`, warning past the timeout. **The arc's disk:** the kernel closure was GC'd twice mid-arc (nothing pinned `nix build --no-link`, the store 98-99% full; the `linux-7.3.1` build needs ~35 GB and failed twice at 31-36 GB free), and two CLI attempts were killed at their own command timeouts (600 s and 2400 s against the ~45-min kernel rebuild); the closure is now rooted at `/tmp/gobridge-vm-root`. Gates: the batch's own, and `nlcap-ws`, `nix-fmt`, `test-goip-docs`, `netlink-audit`, `lint-baseline`. | ## Decision log diff --git a/docs/netlink/gobridge.md b/docs/netlink/gobridge.md index 5669ebf42..ee366f64f 100644 --- a/docs/netlink/gobridge.md +++ b/docs/netlink/gobridge.md @@ -332,6 +332,17 @@ the latest code" section the ethtool doc uses. - **Unit only** (no stock-kernel reply shows them): B4, B7, B8, B9, B11, B12, B13, B15, B16, B18, B19, B20, B23, B27 (found in 6P). B17 is clean: every `-j -s` output parses. +**Fresh boots (V402).** The 6C gate's fresh-boot batches ran 2026-12-04: two batches, +one on the first boot once settled and one on a second boot, 344 of 344 rows over the +four `ws/bridge*` families each, and `verdiff` agrees with the corpus everywhere but the +named timer rows (bridgex ec-021/022/023 and pw-021/022/023; bridgemdb ec-005/006/008 +and pw-005/006/008) — boot against boot, the same 0/6/0/6. A body-level pass (seq and +pid zeroed) finds only V097's two classes: `IFLA_BRPORT_FORWARD_DELAY_TIMER` and the +NLMSG_ERROR bodies' echoed request seq. The first fresh-boot attempt lost 34 rows to the +batch firing 24 s after qemu started, `up` returning at ssh before the guest's systemd +settles; `up` now waits for `is-system-running` (the first wave's ns crosstalk is +recorded in V402; the mechanism is not pinned down, the wait is measured). + **Boundaries the columns must survive.** `VXLAN_ID_LEN` is 17, exactly the width of `16777214-16777215`, and `VLAN_ID_LEN` is 9. The capture pins vni range `16777214-16777215` and vlan range `2-4094`; 6R mirrors the `%-*s` padding, including a negative width if one diff --git a/nix/microvms/workbench/xtcp2-nlcap-ws.sh b/nix/microvms/workbench/xtcp2-nlcap-ws.sh index e55917e89..2aa2c7208 100644 --- a/nix/microvms/workbench/xtcp2-nlcap-ws.sh +++ b/nix/microvms/workbench/xtcp2-nlcap-ws.sh @@ -128,6 +128,31 @@ cmd_up() { fi sleep 3 done + # ssh answers before the guest's boot is done, and a batch fired in + # that window fails: the netns bind mounts the rows create under + # /var/run/netns are disturbed by the boot still settling (V402's + # first boot: 34 of 113 rows, the whole first wave). So up is up only + # when the guest's units are: is-system-running says running or + # degraded (a failed unit is still a settled boot), or the timeout + # expires with a warning that a batch now may crosstalk. The + # mechanism was not pinned down; the wait is measured - 24 s after + # qemu starts is too early, running is enough. + local sysstate + sysstate=$(gssh 'systemctl is-system-running' 2>/dev/null) || sysstate= + if [ "$(date +%s)" -lt "$deadline" ] && \ + [ "$sysstate" != running ] && [ "$sysstate" != degraded ]; then + echo "NLCAP_WS_BOOTING: ssh up, waiting for the guest's units ($sysstate)" >&2 + until [ "$(date +%s)" -ge "$deadline" ]; do + sysstate=$(gssh 'systemctl is-system-running' 2>/dev/null) || sysstate= + case "$sysstate" in + running | degraded) break ;; + *) sleep 3 ;; + esac + done + if [ "$sysstate" != running ] && [ "$sysstate" != degraded ]; then + echo "NLCAP_WS_UP: is-system-running still '$sysstate'; a batch now may fail" >&2 + fi + fi gssh 'uname -r; ip -V' >"$STATE/env" echo "NLCAP_WS_UP $(tr '\n' ' ' <"$STATE/env")" }