[netfilter-cvslog] r7076 - trunk/iptables

kaber at trash.net kaber at trash.net
Wed Oct 17 18:36:49 CEST 2007


Author: kaber at trash.net
Date: 2007-10-17 18:36:49 +0200 (Wed, 17 Oct 2007)
New Revision: 7076

Modified:
   trunk/iptables/ip6tables.c
   trunk/iptables/iptables.c
   trunk/iptables/xtables.c
Log:
[PATCH iptables] print warnings to stderr

iptables prints some of its error messages and warnings to stdout.
This patch applies to svn r7075 and will make iptables print
diagnostic messages to stderr instead.

Signed-off-by: Max Kellermann <max at duempel.org>


Modified: trunk/iptables/ip6tables.c
===================================================================
--- trunk/iptables/ip6tables.c	2007-10-17 08:52:19 UTC (rev 7075)
+++ trunk/iptables/ip6tables.c	2007-10-17 16:36:49 UTC (rev 7076)
@@ -1592,9 +1592,10 @@
 			
 			if (is_exthdr(fw.ipv6.proto)
 			    && (fw.ipv6.invflags & IP6T_INV_PROTO) == 0)
-				printf("Warning: never matched protocol: %s. "
-				       "use extension match instead.\n",
-				       protocol);
+				fprintf(stderr,
+					"Warning: never matched protocol: %s. "
+					"use extension match instead.\n",
+					protocol);
 			break;
 
 		case 's':
@@ -1753,7 +1754,7 @@
 				optarg[0] = '\0';
 				continue;
 			}
-			printf("Bad argument `%s'\n", optarg);
+			fprintf(stderr, "Bad argument `%s'\n", optarg);
 			exit_tryhelp(2);
 
 		default:
@@ -1926,8 +1927,9 @@
 		}
 
 		if (target && ip6tc_is_chain(jumpto, *handle)) {
-			printf("Warning: using chain %s, not extension\n",
-			       jumpto);
+			fprintf(stderr,
+				"Warning: using chain %s, not extension\n",
+				jumpto);
 
 			if (target->t)
 				free(target->t);

Modified: trunk/iptables/iptables.c
===================================================================
--- trunk/iptables/iptables.c	2007-10-17 08:52:19 UTC (rev 7075)
+++ trunk/iptables/iptables.c	2007-10-17 16:36:49 UTC (rev 7076)
@@ -1818,7 +1818,7 @@
 				optarg[0] = '\0';
 				continue;
 			}
-			printf("Bad argument `%s'\n", optarg);
+			fprintf(stderr, "Bad argument `%s'\n", optarg);
 			exit_tryhelp(2);
 
 		default:
@@ -1990,8 +1990,9 @@
 		}
 
 		if (target && iptc_is_chain(jumpto, *handle)) {
-			printf("Warning: using chain %s, not extension\n",
-			       jumpto);
+			fprintf(stderr,
+				"Warning: using chain %s, not extension\n",
+				jumpto);
 
 			if (target->t)
 				free(target->t);

Modified: trunk/iptables/xtables.c
===================================================================
--- trunk/iptables/xtables.c	2007-10-17 08:52:19 UTC (rev 7075)
+++ trunk/iptables/xtables.c	2007-10-17 16:36:49 UTC (rev 7076)
@@ -246,9 +246,10 @@
 			if (vianame[i] == ':' ||
 			    vianame[i] == '!' ||
 			    vianame[i] == '*') {
-				printf("Warning: weird character in interface"
-				       " `%s' (No aliases, :, ! or *).\n",
-				       vianame);
+				fprintf(stderr,
+					"Warning: weird character in interface"
+					" `%s' (No aliases, :, ! or *).\n",
+					vianame);
 				break;
 			}
 		}




More information about the netfilter-cvslog mailing list