Skip to content

Commit c644f55

Browse files
ammarioclaude
andcommitted
Use numeric nftables priorities for compatibility
Replace named priorities (srcnat, dstnat) with numeric values (100, -100) for compatibility with older nftables versions (< 0.9.6) on CI runner. This fixes test failures on the self-hosted runner which has nftables 1.0.6. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a271225 commit c644f55

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/jail/linux/nftables.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pub struct NFTable {
1515

1616
impl NFTable {
1717
/// Create a host-side nftables table with NAT, forward, and input rules
18+
///
19+
/// Note: We use numeric priorities instead of named ones (srcnat, dstnat) for
20+
/// compatibility with older nftables versions (< 0.9.6)
1821
pub fn new_host_table(
1922
jail_id: &str,
2023
subnet_cidr: &str,
@@ -34,7 +37,7 @@ table ip {} {{
3437
}}
3538
3639
chain postrouting {{
37-
type nat hook postrouting priority srcnat; policy accept;
40+
type nat hook postrouting priority 100; policy accept;
3841
ip saddr {} masquerade comment "httpjail_{}"
3942
}}
4043
@@ -132,7 +135,7 @@ table ip {} {{
132135
r#"
133136
table ip {} {{
134137
chain output {{
135-
type nat hook output priority dstnat; policy accept;
138+
type nat hook output priority -100; policy accept;
136139
137140
# Skip DNS traffic
138141
udp dport 53 return

0 commit comments

Comments
 (0)