Repository navigation
Conversation
sjrx-claude-sandbox
force-pushed
the
feat/validators-netdev-link
branch
from
October 24, 2026 14:40
4fc9853 to
df11bf4
Compare
Unit Test Results (grammar engine false)1 428 tests 1 428 ✅ 1m 5s ⏱️ Results for commit 2f351fb. ♻️ This comment has been updated with latest results. |
Unit Test Results (grammar engine true)1 428 tests 1 428 ✅ 1m 4s ⏱️ Results for commit 2f351fb. ♻️ This comment has been updated with latest results. |
sjrx-claude-sandbox
force-pushed
the
feat/validators-netdev-link
branch
3 times, most recently
from
October 24, 2026 17:11
674e9ff to
7cbfdce
Compare
… batch) Adds 34 value validators for systemd-networkd .netdev and udev .link settings that had none (WireGuard keys/endpoints/allowed IPs/route tables, VXLAN/GENEVE/L2TP addresses, VLAN protocol and QoS maps, MACsec key ids and key files, CPU sets and RPS masks, ethtool advertise modes, udev Property=, and more), plus shared helpers in BatchNetdevLinkCombinators.kt (safe_atou numbers incl. 0b/0o/+, parse_size SI chains, parse_nsec durations, CPU sets, key-file paths, route tables). All grammars are derived from the C parsers at systemd 0f0682b773. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e_atou numbers Adds grammar-level tests for the shared helpers (safe_atou bases, parse_size SI chains, parse_nsec durations, CPU sets, key-file paths, WireGuard keys, route tables) using systemd's own unit-test cases, checked against both the classic and the list-of-successes engine. Numbers from the new terminals are now coloured as literals, and AllowedIPs= reads prefix lengths the way in_addr_parse_prefixlen does (safe_atou8, so /0x18 is legal). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
safe_atou_full only refuses a leading '-' when the parsed value is non-zero, so '-0' and '-0x0' are legal. Negative numbers are now number-shaped and reported as out of range instead of as unrecognised characters. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Accept quotes/escapes anywhere in an extract_first_word word (CPU sets, RPS masks, VLAN QoS maps, udev Property= names) via a fallback ExtractedWordTerminal that unquotes/unescapes before checking. - parse_range: refuse -0 as the lower bound; allow whitespace after the dash for PortRange= (safe_atou skips it). - L2TP Local=: allow leading '@' separators. - Key-file paths: catch /dev, /sys, /proc reached via '.' components. - WireGuard Endpoint=: restrict \DDD escapes to 000-255. - Fix PrivateKey= test fixture link; document empty-value handling. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Several batch branches declared public helpers with the same name in the shared grammar package (SafeAtouTerminal, UINT32_LIMIT, safeAtou, SafeAtoNumberTerminal, BOOLEAN_ANY_CASE, COALESCED_COLONS). 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 against systemd's real .netdev/.link parsers built at 0f0682b773. - BatmanAdvanced GatewayBandwidth*=: flag totals of 429496729600000 or more (12P, "3E 2P", 20E); systemd warns and stores a truncated uint32. - VXLAN Group=/Local=/Remote=: apply the key-specific rules (local address type names only for Local=, Group= must be multicast, Local= and Remote= must not be) by picking a per-key grammar. - GENEVE Remote=: refuse multicast addresses. - Add NetdevLinkCheckedSpan, netdevLinkIsMulticast and netdevLinkParseSizeSi for checks on a parsed value. - Tests: oracle-verified values for the above and for the questions in the batch notes (MACsec KeyId=0, QoS maps, Endpoint=:51820, route table names, PortRange=+0b1-2). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The branch had no private case-insensitive boolean copies or names-or-boolean terminals to restructure; its only boolean use (BOOLEAN_FALSE in the WireGuard RouteTable= validators) now inherits case-insensitivity from 242.x. Lock that in with mixed-case false values, and add mixed-case names that systemd's case-sensitive streq/string-table lookups reject (verified with sd-check at 0f0682b773) for IRQAffinityNUMA=, L2TP Local=, ReceivePacketSteeringCPUMask= and VXLAN Local=. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
) Replace the branch's own safe_atou copy (NetdevLinkSafeAtouTerminal, netdevLinkSafeAtou, UINT16_LIMIT, NETDEV_LINK_UINT32_LIMIT) and the parseRange/parseRangeAccepts/extractedRangeWord/optionallyQuoted helpers with SafeAtoTerminal written out at each call site, and switch [VRF] Table=, [WireGuard] RouteTable= and [WireGuardPeer] RouteTable= to the shared ROUTE_TABLE_FROM_STRING (deleting the local ROUTE_TABLE). The WireGuard endpoint port now models parse_ip_port's SAFE_ATO_REFUSE_LEADING_WHITESPACE. Words from whitespace-split lists (IRQAffinity=, *QOSMaps=, AllowedIPs=) use acceptsWhitespace = false. Verdict changes, all checked with sd-check at 0f0682b773: - now accepted: `0b+1`, `0b 1`, `0o 7`, `0b -0` and `0b-0` in the whole-value numbers (DefaultPVID=, PartitionKey=, IPv6FlowLabel=, IRQAffinityNUMA=, PortRange= bounds, Endpoint= port); `0b+1` and `0-0b-0` inside IRQAffinity=/QOSMaps= words; `/0b+1000` in AllowedIPs=; route-table values containing whitespace (possible networkd.conf names) and `0b 1`. - still flagged: `Endpoint=1.2.3.4: 80`, `IRQAffinity=0b 1`, `AllowedIPs=10.0.0.0/0b 1`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
feat/validators-netdev-link
branch
from
October 24, 2026 18:38
7cbfdce to
2f351fb
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.