[iptables] iptables: refer to dmesg if we hit EINVAL

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Tue Mar 24 13:09:07 CET 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=6e70f46f2a146bb7c657f71724c999147a5925dc
commit 6e70f46f2a146bb7c657f71724c999147a5925dc
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Tue Mar 24 13:08:24 2009 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Tue Mar 24 13:08:24 2009 +0100

    iptables: refer to dmesg if we hit EINVAL
    
    With this patch, iptables refers to dmesg for further
    troubleshooting if we hit EINVAL.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  6e70f46f2a146bb7c657f71724c999147a5925dc (commit)
      from  ca6ccdb172b1846152dea421c215122759b84d29 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e70f46f2a146bb7c657f71724c999147a5925dc
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Tue Mar 24 13:08:24 2009 +0100

    iptables: refer to dmesg if we hit EINVAL
    
    With this patch, iptables refers to dmesg for further
    troubleshooting if we hit EINVAL.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 ip6tables-standalone.c |   14 ++++++++++----
 iptables-standalone.c  |   11 ++++++++---
 2 files changed, 18 insertions(+), 7 deletions(-)
With this patch, iptables refers to dmesg for further
troubleshooting if we hit EINVAL.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/ip6tables-standalone.c b/ip6tables-standalone.c
index c0ca645..649ac3d 100644
--- a/ip6tables-standalone.c
+++ b/ip6tables-standalone.c
@@ -68,10 +68,16 @@ main(int argc, char *argv[])
 		ip6tc_free(handle);
 	}
 
-	if (!ret)
-		fprintf(stderr, "ip6tables: %s. "
-				"Run `dmesg' for more information.\n",
-			ip6tc_strerror(errno));
+	if (!ret) {
+		if (errno == EINVAL) {
+			fprintf(stderr, "ip6tables: %s. "
+					"Run `dmesg' for more information.\n",
+				ip6tc_strerror(errno));
+		} else {
+			fprintf(stderr, "ip6tables: %s.\n",
+				ip6tc_strerror(errno));
+		}
+	}
 
 	exit(!ret);
 }
diff --git a/iptables-standalone.c b/iptables-standalone.c
index 208f71d..9185388 100644
--- a/iptables-standalone.c
+++ b/iptables-standalone.c
@@ -69,9 +69,14 @@ main(int argc, char *argv[])
 	}
 
 	if (!ret) {
-		fprintf(stderr, "iptables: %s. "
-				"Run `dmesg' for more information.\n",
-			iptc_strerror(errno));
+		if (errno == EINVAL) {
+			fprintf(stderr, "iptables: %s. "
+					"Run `dmesg' for more information.\n",
+				iptc_strerror(errno));
+		} else {
+			fprintf(stderr, "iptables: %s.\n",
+				iptc_strerror(errno));
+		}
 		if (errno == EAGAIN) {
 			exit(RESOURCE_PROBLEM);
 		}



More information about the netfilter-cvslog mailing list