summaryrefslogtreecommitdiffstats
path: root/iptables
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-11-12 14:29:46 +0100
committerFlorian Westphal <fw@strlen.de>2018-11-12 14:34:10 +0100
commit3ccb443df988fd1d476de55d6ad1f69919d936af (patch)
tree6a5b0875cdca18e79c87aef3bdc10f94477f2ef9 /iptables
parent95db36442a85d9d920f737bbe1f28f145ee3f1b8 (diff)
xtables: Clarify error message when deleting by index
Trying to delete a rule by index from a non-existent chain leads to a somewhat confusing error message: | # iptables-nft -D foobar 1 | iptables: Index of deletion too big. Fix this by performing chain existence checks for CMD_DELETE_NUM, too. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables')
-rw-r--r--iptables/xtables.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 429bd652..24a6e234 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -1040,6 +1040,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
if (p->command == CMD_APPEND ||
p->command == CMD_DELETE ||
+ p->command == CMD_DELETE_NUM ||
p->command == CMD_CHECK ||
p->command == CMD_INSERT ||
p->command == CMD_REPLACE) {