]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: homogenize error message
authorArushi Singhal <arushisinghal19971997@gmail.com>
Sun, 27 May 2018 13:09:01 +0000 (18:39 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 May 2018 22:05:37 +0000 (00:05 +0200)
There is a difference between error messages in iptables and
iptables-compat:

 # iptables-compat -D INPUT 4
 iptables: No chain/target/match by that name.

 # iptables -D INPUT 4
 iptables: Index of deletion too big.

Now, will show same error message.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c

index 603ba306a1ec7872f1b07732ac203f309860b51e..7fd3c48eeadbd31efd3203b91510b695a480b628 100644 (file)
@@ -2673,7 +2673,7 @@ const char *nft_strerror(int err)
            { nft_rule_add, E2BIG, "Index of insertion too big" },
            { nft_rule_check, ENOENT, "Bad rule (does a matching rule exist in that chain?)" },
            { nft_rule_replace, ENOENT, "Index of replacement too big" },
-           { nft_rule_delete_num, E2BIG, "Index of deletion too big" },
+           { nft_rule_delete_num, ENOENT, "Index of deletion too big" },
 /*         { TC_READ_COUNTER, E2BIG, "Index of counter too big" },
            { TC_ZERO_COUNTER, E2BIG, "Index of counter too big" }, */
            { nft_rule_add, ELOOP, "Loop found in table" },