]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
Deprecate add/insert rule 'position' argument
authorPhil Sutter <phil@nwl.cc>
Wed, 9 May 2018 14:03:40 +0000 (16:03 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 May 2018 16:29:21 +0000 (18:29 +0200)
Instead, use 'handle' keyword for the same effect since that is more
consistent with respect to replace/delete commands. The old keyword is
still supported for backwards compatibility and also listed in man page
along with a hint that it shouldn't be used anymore.

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

index 60691580af5fd7b00562bf8fd39b983f94523adc..b80c8c439e2c76ea09f3e0bf1ed3570810638172 100644 (file)
@@ -875,7 +875,13 @@ add table inet mytable
                                <arg choice="opt"><replaceable>family</replaceable></arg>
                                <replaceable>table</replaceable>
                                <replaceable>chain</replaceable>
-                               <arg choice="opt">position <replaceable>handle</replaceable></arg>
+                               <arg choice="opt">
+                                       <group choice="req">
+                                               <arg>handle</arg>
+                                               <arg>position</arg>
+                                       </group>
+                                       <replaceable>handle</replaceable>
+                               </arg>
                                <replaceable>statement</replaceable>...
                        </cmdsynopsis>
                        <cmdsynopsis>
@@ -910,8 +916,10 @@ add table inet mytable
                                <listitem>
                                        <para>
                                                Add a new rule described by the list of statements. The rule is appended to the
-                                               given chain unless a position is specified, in which case the rule is appended to
-                                               the rule given by the handle.
+                                               given chain unless a <literal>handle</literal> is specified, in which case the
+                                               rule is appended to the rule given by the <replaceable>handle</replaceable>.
+                                               The alternative name <literal>position</literal> is deprecated and should not be
+                                               used anymore.
                                        </para>
                                </listitem>
                        </varlistentry>
@@ -920,7 +928,8 @@ add table inet mytable
                                <listitem>
                                        <para>
                                                Similar to the <command>add</command> command, but the rule is prepended to the
-                                               beginning of the chain or before the rule with the given handle.
+                                               beginning of the chain or before the rule with the given
+                                               <replaceable>handle</replaceable>.
                                        </para>
                                </listitem>
                        </varlistentry>
index 24210b2bd58ed5c0f8c3e8abe9c9b822e358a5d9..174150aa3cd4190f2b2298825d77dd1882bb62c3 100644 (file)
@@ -1970,6 +1970,14 @@ rule_position            :       chain_spec
                                handle_merge(&$1, &$2);
                                $$ = $1;
                        }
+                       |       chain_spec      handle_spec
+                       {
+                               $2.position.location = $2.handle.location;
+                               $2.position.id = $2.handle.id;
+                               $2.handle.id = 0;
+                               handle_merge(&$1, &$2);
+                               $$ = $1;
+                       }
                        ;
 
 ruleid_spec            :       chain_spec      handle_spec