Repository navigation
fix(classifier): spell the dstnat chain's priority as -100 so nft before 1.0.9 loads the table - #3179
Merged
Merged
Conversation
…ore 1.0.9 loads the table The classifier table's dstnat chain declared `type nat hook output priority dstnat`. nft up to 1.0.8 pairs the name `dstnat` with the prerouting hook only and refuses it on output with "invalid priority expression value in this context" (the output pairing arrived in nftables 1.0.9, upstream commit 8beafab7, and nft's documented matrix still lists prerouting alone). One refused chain fails the whole transaction, so on Debian 12 (nft 1.0.6) and Ubuntu 22.04 (nft 1.0.2) `min finalize-install` installed no classifier and every host-address box went without per-box egress enforcement. The chain now says `priority -100`, the value `dstnat` names, which every nft accepts on every hook; 1.0.9 and later load the same chain as before. The script is the one source for both the host's table and the guest's, which minimald renders through it, so both are fixed. Tests: a rendered-table check in minimald that every base chain of the native and the guest render names its priority in a form nft before 1.0.9 accepts on its hook, with the name/hook matrix pinned on its own, and install_test.sh asserts the numeric spelling and that no chain names dstnat or srcnat off the one hook old nft takes it on. Refs: gominimal/inbox#1196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
bryan-minimal
marked this pull request as ready for review
November 9, 2026 16:53
Contributor
|
Approved: no findings at Nothing to do. Clobber: none seen. |
agent-137
reviewed
Nov 9, 2026
Member
There was a problem hiding this comment.
Review on Karl's behalf, at 4612dbccd. This is a comment, not an approval. Nothing was built for it: every point comes from reading the code, and each finding says how it was checked.
- CI at head 4612dbc: green (34 success, 3 skipped).
- Existing reviews: minimal-review APPROVE (3/3 personas, no findings) and CodeRabbit APPROVE, both on head.
Should-fix: none.
Nit: none.
No findings. What I checked:
- Every table is family
inet.install-host-classifier.sh:1074declarestable inetand nothing else. In ip, ip6 and inet the namedstnatmeans -100. It means -300 only in the bridge family, and no table here uses that family. So-100onhook outputis exactly whatdstnatstood for. - Every other base chain in the render is valid on nft before 1.0.9:
filterandmangleon output and postrouting.srcnaton postrouting (line 1110).route ... output priority mangleandprerouting manglein classifier.rs.
- No other spelling remains.
git grep "priority (dstnat|srcnat)"finds no otherdstnatorsrcnatpriority incrates/orscripts/. - Nothing reads the listed priority back. No code parses
"prio"or matchespriority dstnatinnft listoutput.classifier_root_integration.rs:1983already accepts bothmangleand-150. - nft 1.0.7's "nat priority above -200" rule is met by -100.
- The
base_chainstest parser does not mistaketypeofset lines for chain declarations ("typeof"does not start with"type "). The guest render goes through the same script.
Verdict: ready to approve.
agent-137
approved these changes
Nov 9, 2026
Member
There was a problem hiding this comment.
Approving at 4612dbccd. The earlier comment review found nothing that needs fixing, and its nits are optional.
This was referenced Nov 12, 2026
Merged
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.
Refs gominimal/inbox#1196.
What
The classifier table's dstnat chain declared
type nat hook output priority dstnat. nft up to 1.0.8 pairs the namedstnatwith the prerouting hook only and refuses it on output withinvalid priority expression value in this context(the output pairing arrived in nftables 1.0.9, upstream commit 8beafab7; nft's documented matrix still lists prerouting alone). One refused chain fails the whole transaction, so on Debian 12 (nft 1.0.6) and Ubuntu 22.04 (nft 1.0.2)min finalize-installinstalled no classifier and every host-address box went without per-box egress enforcement.The chain now says
priority -100, the valuedstnatnames, which every nft accepts on every hook (evaluate_prioritytakes an integer before any name lookup; the only numeric rule, 1.0.7's "nat chains must have a priority above -200", is cleared). 1.0.9 and later load the same chain as before and list it aspriority dstnatagain; nothing in the tree reads a listed priority back.scripts/install-host-classifier.shis the one source for both the host's table (embedded inmin, printed and run by finalize-install) and the guest's (embedded in minimald, which renders and loads it), so both are fixed by the one line.Tests
classifier.rs:pre_1_0_9_nft_priority_matrixpins the name/hook matrix old nft enforces;every_base_chain_loads_on_nft_before_1_0_9parses everytype … hook … priority …;line of the native render and the guest render, holds each to that matrix, and pins the dstnat chain as("nat", "output", "-100").scripts/install_test.sh: the "steer runs at dstnat" check grepspriority -100;, and two newwant_errchecks rejectdstnatoff prerouting andsrcnatoff postrouting.Verification
OK: 1196-nft-priority-4612dbcc: 2 expectation(s) on debian-12, ubuntu-22.04: 727-host-ip-egress-fail-open:env->pass 808-finalize-install-with-tailscale-connmark:env->pass
min-regress batch
1196-nft-priority-4612dbcc: baserel-6a01d5aevs the candidatecand-1196-nft-priority-4612dbcc-1311ef44, per distro:Lab evidence (min-regress batch
1196-nft-priority-4612dbccon the lab box, debian-12, ubuntu-22.04, ubuntu-24.04)Head:
4612dbccd602b07924d7a8b74416d206e559df6dat 4612dbc (lab namecand-1196-nft-priority-4612dbcc-1311ef44). Base:rel-6a01d5ae(rel-6a01d5ae).session policybut never enforced (fail-open)session policybut never enforced (fail-open)session policybut never enforced (fail-open)Fixed since base: 0. Still reproducing on both: 0. Regressed: 0. Passing on both: 2. Inconclusive cells (an environment or setup failure on a side, not counted): 4. A verdict links to the run's trace in Cloud Trace (project access needed); the scenario link is its source with the
# issue:it reproduces.OK: 1196-nft-priority-4612dbcc: 2 expectation(s) on ubuntu-24.04: 727-host-ip-egress-fail-open:pass 808-finalize-install-with-tailscale-connmark:pass
min-regress batch
1196-nft-priority-4612dbcc: baserel-6a01d5aevs the candidatecand-1196-nft-priority-4612dbcc-1311ef44, per distro:Lab evidence (min-regress batch
1196-nft-priority-4612dbccon the lab box, debian-12, ubuntu-22.04, ubuntu-24.04)Head:
4612dbccd602b07924d7a8b74416d206e559df6dat 4612dbc (lab namecand-1196-nft-priority-4612dbcc-1311ef44). Base:rel-6a01d5ae(rel-6a01d5ae).session policybut never enforced (fail-open)session policybut never enforced (fail-open)session policybut never enforced (fail-open)Fixed since base: 0. Still reproducing on both: 0. Regressed: 0. Passing on both: 2. Inconclusive cells (an environment or setup failure on a side, not counted): 4. A verdict links to the run's trace in Cloud Trace (project access needed); the scenario link is its source with the
# issue:it reproduces.🤖 Generated with Claude Code
Summary by CodeRabbit