]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: use 'flow add' syntax
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Mar 2019 10:32:58 +0000 (11:32 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Mar 2019 10:43:29 +0000 (11:43 +0100)
As discussed during NFWS 2018. Old syntax is stilled allowed.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
doc/nft.txt
doc/statements.txt
src/ct.c
src/parser_bison.y
tests/shell/testcases/flowtable/0001flowtable_0
tests/shell/testcases/flowtable/0005delete_in_use_1
tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft

index a4ab4a8e5ca0ae12b76059db8b773a923225aa70..d162dad07e06d0b74ff70160fd808b52d332cfd2 100644 (file)
@@ -585,7 +585,7 @@ address - to update the destination link-layer address - to forward packets.
 The ttl and hoplimit fields are also decremented. Hence, flowtables provides an
 alternative path that allow packets to bypass the classic forwarding path.
 Flowtables reside in the ingress hook that is located before the prerouting
-hook. You can select which flows you want to offload through the flow offload
+hook. You can select which flows you want to offload through the flow
 expression from the forward chain. Flowtables are identified by their address
 family and their name. The address family must be one of ip, ip6, or inet. The inet
 address family is a dummy family which is used to create hybrid IPv4/IPv6
index a5822cf0aeb76ab433bab66800067456c65d6d00..0687f53f83076f67e152c9c67c7595722b861a55 100644 (file)
@@ -439,13 +439,13 @@ table inet x {
 }
 -------------------------------------
 
-FLOW OFFLOAD STATEMENT
-~~~~~~~~~~~~~~~~~~~~~~
-A flow offload statement allows us to select what flows you want to accelerate
+FLOW STATEMENT
+~~~~~~~~~~~~~~
+A flow statement allows us to select what flows you want to accelerate
 forwarding through layer 3 network stack bypass. You have to specify the
 flowtable name where you want to offload this flow.
 
-*flow offload* @flowtable
+*flow add* @flowtable
 
 QUEUE STATEMENT
 ~~~~~~~~~~~~~~~
index e77c3201eb5d0568e2b217568056884d059db211..ca31f49850d41028878885b016e629bc95bc8240 100644 (file)
--- a/src/ct.c
+++ b/src/ct.c
@@ -481,7 +481,7 @@ struct stmt *notrack_stmt_alloc(const struct location *loc)
 static void flow_offload_stmt_print(const struct stmt *stmt,
                                    struct output_ctx *octx)
 {
-       printf("flow offload @%s", stmt->flow.table_name);
+       printf("flow add @%s", stmt->flow.table_name);
 }
 
 static const struct stmt_ops flow_offload_stmt_ops = {
index 48e44e5adc406fed8f795f3052be124d3d781875..65b3fb3ebac24351a499cf5cd9992412370880fe 100644 (file)
@@ -3915,6 +3915,10 @@ meta_stmt                :       META    meta_key        SET     stmt_expr
                        {
                                $$ = flow_offload_stmt_alloc(&@$, $4);
                        }
+                       |       FLOW    ADD     AT string
+                       {
+                               $$ = flow_offload_stmt_alloc(&@$, $4);
+                       }
                        ;
 
 socket_expr            :       SOCKET  socket_key
index 90b23dc38d6feed1b6e9a3266e8d48387c30f191..8336ec5a8f37f4dacc59b9ad8236db700dec45dc 100755 (executable)
@@ -7,7 +7,7 @@ EXPECTED='table inet t {
        }
 
        chain c {
-               flow offload @f
+               flow add @f
        }
 }'
 
index 149d64442fdde15fbcf09e5f14eeef8484fb13c8..ef52620d9958cd2559122987a3d215175e800389 100755 (executable)
@@ -4,7 +4,7 @@ set -e
 $NFT add table x
 $NFT add chain x x
 $NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;}
-$NFT add rule x x flow offload @y
+$NFT add rule x x flow add @y
 
 $NFT delete flowtable x y || exit 0
 echo "E: delete flowtable in use"
index 6a1c7b81dbd2383ec22baf903ac511d57d9fa751..629bfe81cb18a5230b613b77a8362239d60a16e2 100644 (file)
@@ -5,6 +5,6 @@ table inet t {
        }
 
        chain c {
-               flow offload @f
+               flow add @f
        }
 }