]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: refer to dmesg if we hit EINVAL v1.4.3.1
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Mar 2009 12:08:24 +0000 (13:08 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Mar 2009 12:08:24 +0000 (13:08 +0100)
With this patch, iptables refers to dmesg for further
troubleshooting if we hit EINVAL.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
ip6tables-standalone.c
iptables-standalone.c

index c0ca64596ef1d2295dfe45633d90bd2f16d5bf1f..649ac3d81cf8fbde6e11a93f91202fd6589226fd 100644 (file)
@@ -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);
 }
index 208f71d7461aa8c0d933ad1f50da7b8720800c48..91853884b3d6378deed12301e29c8c8379109955 100644 (file)
@@ -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);
                }