From: Phil Sutter Date: Mon, 12 Nov 2018 13:29:46 +0000 (+0100) Subject: xtables: Clarify error message when deleting by index X-Git-Tag: v1.8.2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ccb443df988fd1d476de55d6ad1f69919d936af;p=thirdparty%2Fiptables.git 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 --- 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) {