diff mbox

[iptables] ip6tables: Use consistent exit code for EAGAIN

Message ID 1383365314-12290-1-git-send-email-cernekee@gmail.com
State Accepted
Headers show

Commit Message

Kevin Cernekee Nov. 2, 2013, 4:08 a.m. UTC
As of commit 056564f6a (Add new exit value to indicate concurrency
issues), the IPv4 iptables binary returns exit status 4 to indicate that
the kernel returned EAGAIN when trying to update a table.  But ip6tables
still returns exit status 1 under the same circumstances.  Update
ip6tables to bring it in line with iptables behavior.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 iptables/ip6tables-standalone.c |    3 +++
 1 file changed, 3 insertions(+)

Comments

Pablo Neira Ayuso Nov. 3, 2013, 9:43 p.m. UTC | #1
On Fri, Nov 01, 2013 at 09:08:34PM -0700, Kevin Cernekee wrote:
> As of commit 056564f6a (Add new exit value to indicate concurrency
> issues), the IPv4 iptables binary returns exit status 4 to indicate that
> the kernel returned EAGAIN when trying to update a table.  But ip6tables
> still returns exit status 1 under the same circumstances.  Update
> ip6tables to bring it in line with iptables behavior.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/iptables/ip6tables-standalone.c b/iptables/ip6tables-standalone.c
index 656e08d..4e20fe6 100644
--- a/iptables/ip6tables-standalone.c
+++ b/iptables/ip6tables-standalone.c
@@ -73,6 +73,9 @@  ip6tables_main(int argc, char *argv[])
 			fprintf(stderr, "ip6tables: %s.\n",
 				ip6tc_strerror(errno));
 		}
+		if (errno == EAGAIN) {
+			exit(RESOURCE_PROBLEM);
+		}
 	}
 
 	exit(!ret);