Repository navigation
gotc: action writes for the twelve increment-12 kinds (increment 22) - #375
Merged
Merged
Conversation
363 rows (269 writes, 94 refusals) for tc actions add, change, replace, delete and flush across police, mirred, skbedit, vlan, csum, nat, simple, connmark, ctinfo, sample, skbmod and mpls, standalone and in filters, with the frame words, the 32-action bound, the batches and a row for each sweep lead. The increment-23 kinds get out- rows. Two batches on one boot agree. The write-up starts in docs/netlink/upstream/iproute2-tc-action-write.md: W156-W215 plus the new W187 and W188, and K63-K76 (not submitted to netdev). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Append for the parms structs of increment 12's kinds (tc_gen, tc_police, tc_mirred, tc_vlan/mpls/csum, tc_nat, tc_connmark with its zeroed tail padding, tc_skbmod), each re-laying tc's captured PARMS byte for byte. IsAdmittedWriteType admits RTM_NEWACTION and RTM_DELACTION, and the gotc_write BuildTcActionWriteRequest, PutTcActDeleteTab and PutTcActFlushAttrs reproduce tc's add, change, replace, delete and flush requests, W177-W180 included. The goip_write gate test's admitted set also gains the filter and chain pairs it had missed since 20W. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tc actions add|change|replace|delete|flush (do_action's write verbs) and the parse side of police, mirred, skbedit, vlan, csum, nat, simple, connmark, ctinfo, sample, skbmod and mpls, standalone and in filters, through an actParsers registry; filter-side police goes live for basic, cgroup, fw, route, u32 and flow. Increment 23's six kinds stay refused by name. W189: simple's 32-byte copy is rebuilt from argv's memory (argmem.go): the command line's words, or getline's line buffer in a batch; past them gotc sends zeros and the replay masks them (w189Canon). All 363 tcactwrite rows replay byte for byte. tdc: 332 action writes match and 184 are refused by kind; filter writes match 276 (was 245). W166 is copied as x86 casts it, not refused as planned. W184's argv cut is shared with tbf (sizeCellShown). Three fuzz targets ran 60s clean; all 10 mutants were killed; coverage 85.6%/86.4%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goconst: word constants for the control words, index, modify and minburst where 22W repeated them. gocyclo: policeLoop splits into policeWordClass (act_parse_police's arms in order, which the prefixes need) and the value arms. funlen: route's to and from share routeRealm. S1019 in 22P's encoder test, a misspelling and a prealloc in aw_test.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iproute2-tc-action-write.md is finished: a gotc column on the 60 summary rows, the HEAD check (no in-scope tc file changed since v7.2.0; lib/ll_addr.c's 5faf18f672c1 partly fixes W172; no act_*.c change after v7.4-rc4), and entries for W200 and W202. W179 is corrected from ec-231's readback: the kernel deletes 32 of 33 and keeps the 33rd silently (K8 on the delete side). W188 is dropped as a duplicate of AC33. Extensions where the leads live: AC6, AC7, AC33, AC34 (corrected by W178/K70), AC70 and K8 in iproute2-tc-action.md; W65, W68, W74, W75, W85, W113, W114, W117 and W121 in iproute2-tc-filter-write.md. V062's gates now record lint-baseline (tiers 0-2) and no-write-encoders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tc 7.2.0 and the gotc_write build ran side by side on the workbench for the 363 tcactwrite rows and tcfwrite ec-111..113. 342/366 are identical (55 where only tc hears the kernel, 10 once W189's bytes are masked). The named exceptions are increment 23's six refusals by name and 18 mirred requests whose only differing field is d1's ifindex (the capture harness's nlmon0 shifts it by one). tc matches the corpus on every row, so the kernel answers behind K63-K76 recurred. No new lead. The VM was left as found: modules removed, no namespace, no core file, powered off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A MAC group that is a bare 0x is no conversion in glibc's %x: skbmod's sscanfMac and vlan's llAddrA2N (now on scanfHex, not the strtoul model) refuse it as tc 7.2.0 does. - The NULs tc's parsers write into argv and never put back (ll_addr_a2n's colons, skbedit's mark slash, get_size64_and_cell's slash on a failure, flow's key commas, fw's handle slash) now persist in the batch line buffer, so a later line's sdata copies them as tc does (W189). TestGotcBatchArgvNuls is checked against host tc 7.2.0 under strace. W189 and W196 extended in iproute2-tc-action-write.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increment 22: dry-run action writes for tc 7.2.0. This covers
tc actions add|change|replace|delete|flushand actions inside filters. The parts ported are m_action.c's write paths and the parsers for increment 12's twelve kinds: police (including filter-side police), mirred, skbedit, vlan, csum, nat, simple, connmark, ctinfo, sample, skbmod and mpls.tcactwritecapture space with 363 rows: 269 writes and 94 refusals. Two batches on one boot agree on every row and on all 295 requests (V060).Appendencoders for the seven parms structs (TcGen,TcPolice,TcMirred,TcActInt,TcNat,TcConnmark,TcSkbmod) andBuildTcActionWriteRequest. The write gate now admits RTM_NEWACTION and RTM_DELACTION (V061).actParsersregistry (V062).tcactwritereplays 363/363. pedit, tunnel_key, ife, ct, gate and bpf stay refused by name until increment 23.tc actionswrites match, and 184 are refused by kind. Filter writes that match go from 245 to 276.burstandmtuerrors now cut the word at the/the way tc does (W184).docs/netlink/upstream/iproute2-tc-action-write.md. Not sent to netdev (DOC015).0xMAC group is now refused, as glibc's%xrefuses it. This covers skbmodset dmac 0x:2:3:4:5:6and vlan's MACs (W196).simple sdatacopies them as tc does (W189).Gates:
go test ./...,test-go-race, lint-baseline (tiers 0-2) and no-write-encoders pass.🤖 Generated with Claude Code