netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iptables-compat: homogenize error messages with 'R' option
@ 2014-11-05 15:46 Ana Rey
  2014-11-10 17:16 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Ana Rey @ 2014-11-05 15:46 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Ana Rey

There is a difference between error messages in iptables and
iptables-compat:

 # iptables -R INPUT 23 -s 192.168.2.140 -j ACCEPT
iptables: Index of replacement too big.
 # iptables-compat -R INPUT 23 -s 192.168.2.140 -j ACCEPT
iptables: No chain/target/match by that name.

Now, iptables-compat shows the same error message than iptables in
this case.

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 iptables/nft.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables/nft.c b/iptables/nft.c
index 6cb03a0..64222af 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -2358,7 +2358,7 @@ const char *nft_strerror(int err)
 	    { nft_chain_user_add, EEXIST, "Chain already exists" },
 	    { 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, E2BIG, "Index of replacement too big" },
+	    { nft_rule_replace, ENOENT, "Index of replacement too big" },
 	    { nft_rule_delete_num, E2BIG, "Index of deletion too big" },
 /*	    { TC_READ_COUNTER, E2BIG, "Index of counter too big" },
 	    { TC_ZERO_COUNTER, E2BIG, "Index of counter too big" }, */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iptables-compat: homogenize error messages with 'R' option
  2014-11-05 15:46 [PATCH] iptables-compat: homogenize error messages with 'R' option Ana Rey
@ 2014-11-10 17:16 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2014-11-10 17:16 UTC (permalink / raw)
  To: Ana Rey; +Cc: netfilter-devel

On Wed, Nov 05, 2014 at 04:46:34PM +0100, Ana Rey wrote:
> There is a difference between error messages in iptables and
> iptables-compat:
> 
>  # iptables -R INPUT 23 -s 192.168.2.140 -j ACCEPT
> iptables: Index of replacement too big.
>  # iptables-compat -R INPUT 23 -s 192.168.2.140 -j ACCEPT
> iptables: No chain/target/match by that name.
> 
> Now, iptables-compat shows the same error message than iptables in
> this case.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-10 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 15:46 [PATCH] iptables-compat: homogenize error messages with 'R' option Ana Rey
2014-11-10 17:16 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).