Skip to contentSkip to conversation

doc: nft.8: Document lower priority limit for nat type chains

PATCH In review Phil Sutter 2 participants 5 messages Mar 9, 2023 – Mar 10, 2023 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 doc: nft.8: Document lower priority limit for nat type chains

Users can't know the magic limit.

---
 doc/nft.txt | 3 +++
 1 file changed, 3 insertions(+)
doc/nft.txt +3 -0
index 7de4935b4b375..0d60c7520d31e 100644
@@ -439,6 +439,9 @@ name which specifies the order in which chains with the same *hook* value are
 traversed. The ordering is ascending, i.e. lower priority values have precedence
 over higher ones.
 
+With *nat* type chains, there's a lower excluding limit of -200 for *priority*
+values, because conntrack hooks at this priority and NAT requires it.
+
 Standard priority values can be replaced with easily memorizable names.  Not all
 names make sense in every family with every hook (see the compatibility matrices
 below) but their numerical value can still be used for prioritizing chains.
Signature · 1 line
2.38.0
#1 lore raw
Quoted 12 lines · Phil Sutter

Users can't know the magic limit.

---
 doc/nft.txt | 3 +++
 1 file changed, 3 insertions(+)
doc/nft.txt +0 -0
index 7de4935b4b375..0d60c7520d31e 100644

doc/nft.txt name which specifies the order in which chains with the same *hook* value are · line 443

Quoted 5 lines
doc/nft.txt +2 -0
@@ -439,6 +439,9 @@ name which specifies the order in which chains with the same *hook* value are
 traversed. The ordering is ascending, i.e. lower priority values have precedence
 over higher ones.
 
+With *nat* type chains, there's a lower excluding limit of -200 for *priority*
+values, because conntrack hooks at this priority and NAT requires it.

prerouting, output -200 NF_IP_PRI_CONNTRACK

this should only apply in these two hooks, it should be possible to relax this in input and postrouting in the kernel.

Quoted 7 lines
doc/nft.txt +1 -0
+
 Standard priority values can be replaced with easily memorizable names.  Not all
 names make sense in every family with every hook (see the compatibility matrices
 below) but their numerical value can still be used for prioritizing chains.
Signature · 1 line
2.38.0
author reviewer
#2 lore raw
Quoted 16 lines · Pablo Neira Ayuso
Quoted 15 lines · Phil Sutter

Users can't know the magic limit.

---
 doc/nft.txt | 3 +++
 1 file changed, 3 insertions(+)
doc/nft.txt +0 -0
index 7de4935b4b375..0d60c7520d31e 100644
@@ -439,6 +439,9 @@ name which specifies the order in which chains with the same *hook* value are
 traversed. The ordering is ascending, i.e. lower priority values have precedence
 over higher ones.
 
Quoted 7 lines

doc/nft.txt name which specifies the order in which chains with the same *hook* value are · line 443

Quoted 2 lines
doc/nft.txt +2 -0
+With *nat* type chains, there's a lower excluding limit of -200 for *priority*
+values, because conntrack hooks at this priority and NAT requires it.

prerouting, output -200 NF_IP_PRI_CONNTRACK

this should only apply in these two hooks, it should be possible to relax this in input and postrouting in the kernel.

So far nobody has complained, right? Motivation for my patch came from a question in IRC, I don't think there was a real need for more priority "space" in nat type chains. So while we may relax the restriction, I don't see the motivation to do so. :)

Cheers, Phil

#3 lore raw
Quoted 22 lines · Phil Sutter
Quoted 21 lines · Pablo Neira Ayuso
Quoted 12 lines · Phil Sutter

Users can't know the magic limit.

---
 doc/nft.txt | 3 +++
 1 file changed, 3 insertions(+)
doc/nft.txt +0 -0
index 7de4935b4b375..0d60c7520d31e 100644

doc/nft.txt name which specifies the order in which chains with the same *hook* value are · line 443

Quoted 5 lines
doc/nft.txt +2 -0
@@ -439,6 +439,9 @@ name which specifies the order in which chains with the same *hook* value are
 traversed. The ordering is ascending, i.e. lower priority values have precedence
 over higher ones.
 
+With *nat* type chains, there's a lower excluding limit of -200 for *priority*
+values, because conntrack hooks at this priority and NAT requires it.

prerouting, output -200 NF_IP_PRI_CONNTRACK

Quoted 7 lines
Quoted 2 lines

this should only apply in these two hooks, it should be possible to relax this in input and postrouting in the kernel.

So far nobody has complained, right? Motivation for my patch came from a question in IRC, I don't think there was a real need for more priority "space" in nat type chains. So while we may relax the restriction, I don't see the motivation to do so. :)

It is fine, this can be updated later. Please push it out because release is coming.

It should be also possible to warn user via error reporting from userspace.