]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Support --init-table command
authorPhil Sutter <phil@nwl.cc>
Thu, 2 Aug 2018 15:05:32 +0000 (17:05 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 4 Aug 2018 14:32:43 +0000 (16:32 +0200)
This effectively flushes all built-in chains and removes user-defined
ones. Since compat layer takes care of built-in table/chain creation, it
is sufficient to just drop the relevant table.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/xtables-eb.c

index e6a17a00cd5c7a51114a35e6f54291368a80c51d..b051e9f553c89ad5bc869d3bc24ddde4053ecd7b 100644 (file)
@@ -1169,7 +1169,9 @@ print_zero:
                        break;*/
                /*case 7 :*/ /* atomic-init */
                /*case 10:*/ /* atomic-save */
-               /*case 11:*/ /* init-table */
+               case 11: /* init-table */
+                       nft_table_flush(h, *table);
+                       return 1;
                /*
                        replace->command = c;
                        if (OPT_COMMANDS)