Repository navigation
Conversation
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-route-addr
branch
from
October 24, 2026 14:41
3779a2d to
060a232
Compare
Unit Test Results (grammar engine true)1 425 tests 1 425 ✅ 1m 12s ⏱️ Results for commit 2f917d2. ♻️ This comment has been updated with latest results. |
Unit Test Results (grammar engine false)1 425 tests 1 425 ✅ 48s ⏱️ Results for commit 2f917d2. ♻️ This comment has been updated with latest results. |
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-route-addr
branch
3 times, most recently
from
October 24, 2026 17:11
3ecd32b to
32d0455
Compare
…d RA settings (network-route-addr batch) Adds C-grounded value grammars (systemd 0f0682b773) for the [Route], [RoutingPolicyRule], [Address], [Neighbor], [IPv6AddressLabel], [IPv6SendRA]/[IPv6RoutePrefix]/[IPv6PREF64Prefix]/[IPv6AcceptRA] and [CAN] settings, plus the generic match/strv/string parsers, with tests for each. Shared helpers live in BatchNetworkRouteAddrCombinators.kt: a Checked value-predicate wrapper, a safe_atou*-accurate number terminal, structural parse_sec()/parse_size() grammars with exact value evaluation, and extract_first_word() word shapes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- RoutingPolicyRule User=: no longer crash the new engine on an over-long
UID (toLongOrNull); Checked now only runs its predicate on spans whose
tokens are all individually valid.
- RoutingPolicyRule IPProtocol=: accept aggfrag (the generated table comes
from systemd's vendored uapi headers), and refuse numbers that have no
IPPROTO_* name, as parse_ip_protocol_full(relaxed=false) does.
- NFTSet=: model extract_many_words(":") separator coalescing (leading,
repeated and trailing colons) and quotes anywhere in a word.
- safe_atou* skip leading whitespace: accept it after ':' / '/' in
RouteMetric=, IPv6 route/label prefixes and FirewallMark= masks; accept a
single trailing ':' on the RouteMetric= triple.
- parse_sec: refuse '+.5'.
- IPv6SendRA=: boolean only (key-specific check); IPv6PrefixDelegation=
keeps static/dhcpv6.
- Stacked netdevs: refuse names parse_ifindex() reads as an ifindex (0x10).
- RoutingPolicyRule Table= reports its own parser name; evidence anchors
corrected.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… names Several batch branches declared top-level helpers with the same name in the shared grammar package (SafeAtouTerminal, UINT32_LIMIT, BOOLEAN_ANY_CASE, PARSE_SEC, USEC_INFINITY). Each branch compiled alone but any two merged together would not. Prefix them per family so the batch PRs can merge in any order; consolidating them into Combinators.kt is left for a follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checked every network-route-addr mismatch from the systemd oracle diff against the real parsers at 0f0682b773. None is a plugin bug: - IPv6SendRA=static/dhcpv6: the inspection already flags them per key; the diff harness only sees the shared union combinator. - BootFilename=/NetLabel= with quotes or backslashes: systemd logs at warning level but drops the value (and for NetLabel= the whole [Address] section), so the plugin keeps flagging them. - Route/RoutingPolicyRule Table= names, User= names and Timezone= existence depend on networkd.conf, NSS and tzdata at runtime, so they stay deliberately lenient. Adds the oracle-verified values to the tests and refreshes a stale comment that said the TABLE/FWMARK/IP_PROTOCOL ltypes were unvalidated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dr validators Drop NETWORK_ROUTE_ADDR_BOOLEAN_ANY_CASE now that BOOLEAN matches parse_boolean()'s STRCASE_IN_SET. IPv6SendRA=/IPv6PrefixDelegation= use the explicit PreferValidAlternativeCombinator(names, BOOLEAN) form, with case-sensitive names as string_table_lookup_from_string uses streq. IPProtocol= keeps ignoreCase (gperf --ignore-case plus an ascii_strlower retry) and moves to PreferValidAlternativeCombinator so the lenient name regex cannot shadow a number on the classic engine. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tors (#563) Replace the batch-local NetworkRouteAddrSafeAtouTerminal, safeAtouValue() and NETWORK_ROUTE_ADDR_UINT32_LIMIT with SafeAtoTerminal, and switch [Route] Table= / [RoutingPolicyRule] Table= to ROUTE_TABLE_FROM_STRING (dropping the private ROUTE_TABLE_NAME). parse_uid in [RoutingPolicyRule] User= and parse_ifindex in MultiPathRoute= and the stacked-netdev names now use SafeAtoTerminal too, with safe_atoi's signedness. Verdict changes, each confirmed with sd-check at 0f0682b773: - now flagged (EINVAL, glibc C23 0b parsing is off): +0b1, -0b0, +0o7 in InitialCongestionWindow=, Label=, FirewallMark=, RouteMetric=, the MultiPathRoute= weight, prefix lengths, and IPProtocol=+0b110 - now accepted: 0b 1, 0b+1, 0o 7 and a leading \v wherever the whole value or a field after ':' or '/' reaches safe_atou*; Table=0b 1; Table=main table (possible networkd.conf name); VLAN=+0b1 (not an ifindex, so a valid name); User=\v5 and User=5-\v6 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
feat/validators-network-route-addr
branch
from
October 24, 2026 18:37
32d0455 to
2f917d2
Compare
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.
No description provided.