From 3ccb443df988fd1d476de55d6ad1f69919d936af Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 12 Nov 2018 14:29:46 +0100 Subject: 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 --- iptables/xtables.c | 1 + 1 file changed, 1 insertion(+) (limited to 'iptables/xtables.c') 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) { -- cgit v1.2.3