src: use 'flow add' syntax
Pablo Neira Ayuso
maintainerPATCH v2 1/2 src: use 'flow add' syntax
As discussed during NFWS 2018. Old syntax is stilled allowed.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- doc/nft.txt | 2 +- doc/statements.txt | 6 +++--- src/ct.c | 2 +- src/parser_bison.y | 4 ++++ tests/shell/testcases/flowtable/0001flowtable_0 | 2 +- tests/shell/testcases/flowtable/0005delete_in_use_1 | 2 +- tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-)
doc/nft.txt +1 -1
@@ -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
doc/statements.txt +3 -3
@@ -439,13 +439,13 @@ table inet x { } ------------------------------------- -FLOW OFFLOAD STATEMENT +FLOW STATEMENT ~~~~~~~~~~~~~~~~~~~~~~ -A flow offload statement allows us to select what flows you want to accelerate +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 ~~~~~~~~~~~~~~~
src/ct.c +1 -1
@@ -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 = {
src/parser_bison.y +4 -0
@@ -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
tests/shell/testcases/flowtable/0001flowtable_0 +1 -1
@@ -7,7 +7,7 @@ EXPECTED='table inet t { } chain c { - flow offload @f + flow add @f } }'
tests/shell/testcases/flowtable/0005delete_in_use_1 +1 -1
@@ -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"
tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft +1 -1
@@ -5,6 +5,6 @@ table inet t { } chain c { - flow offload @f + flow add @f } }
Signature · 1 line
2.11.0