diff options
author | Phil Sutter <phil@nwl.cc> | 2023-01-26 03:27:16 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2023-01-31 16:29:26 +0100 |
commit | b51aef061378b34fa9544b1af34021d89a76547a (patch) | |
tree | 21f6fe48e54cdb4a2cbed92e98bfd99244ddeb9a /iptables/xtables-eb-translate.c | |
parent | 3f7da77726d4089237d9c0ed1794892ec001879c (diff) |
ebtables-translate: Print flush command after parsing is finished
Otherwise, bad calls like 'ebtables-translate -F -F' produce wrong
output instead of an error message.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xtables-eb-translate.c')
-rw-r--r-- | iptables/xtables-eb-translate.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/iptables/xtables-eb-translate.c b/iptables/xtables-eb-translate.c index 99347c0c..da7e5e3d 100644 --- a/iptables/xtables-eb-translate.c +++ b/iptables/xtables-eb-translate.c @@ -247,13 +247,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char ret = 1; break; case 'F': /* Flush */ - if (p.chain) { - printf("flush chain bridge %s %s\n", p.table, p.chain); - } else { - printf("flush table bridge %s\n", p.table); - } - ret = 1; - break; case 'Z': /* Zero counters */ if (c == 'Z') { if ((flags & OPT_ZERO) || (flags & OPT_COMMAND && command != 'L')) @@ -506,6 +499,13 @@ print_zero: if (command == 'P') { return 0; + } else if (command == 'F') { + if (p.chain) { + printf("flush chain bridge %s %s\n", p.table, p.chain); + } else { + printf("flush table bridge %s\n", p.table); + } + ret = 1; } else if (command == 'A') { ret = nft_rule_eb_xlate_add(h, &p, &cs, true); if (!ret) |