]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
nft.8: Clarify 'index' option of add rule command
authorPhil Sutter <phil@nwl.cc>
Mon, 12 Nov 2018 14:02:52 +0000 (15:02 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Nov 2018 15:35:18 +0000 (16:35 +0100)
Documentation for add rule command might trick readers into believing
the optional 'index' argument does not need to be that of an existing
rule. This false assumption is fueled by the fact that iptables allows
to insert with last rule number + 1 to actually append to a chain.
Change the relevant sentence to clarify that.

While being at it, drop the deprecated 'position' option from
documentation - since this will likely go away at some point, don't
encourage users to use it although they should notice that they
shoudn't.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
doc/nft.txt

index 030e67e950feeea38d9f89420017f3e527493a3e..fca91450f5b8fb0e404b3b3b68697958199ed5ed 100644 (file)
@@ -404,7 +404,7 @@ values are *accept* (which is the default) or *drop*.
 RULES
 -----
 [verse]
-{add | insert} *rule* ['family'] 'table' 'chain' [ {handle | position} 'handle' | index 'index' ] 'statement' ... [ comment 'comment' ]
+{add | insert} *rule* ['family'] 'table' 'chain' [ handle 'handle' | index 'index' ] 'statement' ... [ comment 'comment' ]
 replace *rule* ['family'] 'table' 'chain' handle 'handle' 'statement' ... [ comment 'comment' ]
 delete *rule* ['family'] 'table' 'chain' handle 'handle'
 
@@ -413,15 +413,13 @@ ip family is used. Rules are constructed from two kinds of components according
 to a set of grammatical rules: expressions and statements.
 
 The add and insert commands support an optional location specifier, which is
-either a 'handle' of an existing rule or an 'index' (starting at zero).
+either a 'handle' or the 'index' (starting at zero) of an existing rule.
 Internally, rule locations are always identified by 'handle' and the translation
 from 'index' happens in userspace. This has two potential implications in case a
 concurrent ruleset change happens after the translation was done: The effective
 rule index might change if a rule was inserted or deleted before the referred
 one. If the referred rule was deleted, the command is rejected by the kernel
 just as if an invalid 'handle' was given.
-The old name "position" in place of "handle" is deprecated
-and should not be used anymore.
 
 A 'comment' is a single word or a double-quoted (") multi-word string which can
 be used to make notes regarding the actual rule. *Note:* If you use bash for