netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iptables] print warnings to stderr
@ 2007-10-17 15:06 Max Kellermann
  0 siblings, 0 replies; only message in thread
From: Max Kellermann @ 2007-10-17 15:06 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

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@duempel.org>

 ip6tables.c |   14 ++++++++------
 iptables.c  |    7 ++++---
 xtables.c   |    7 ++++---
 3 files changed, 16 insertions(+), 12 deletions(-)

Index: xtables.c
===================================================================
--- xtables.c	(revision 7075)
+++ xtables.c	(working copy)
@@ -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;
 			}
 		}
Index: iptables.c
===================================================================
--- iptables.c	(revision 7075)
+++ iptables.c	(working copy)
@@ -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);
Index: ip6tables.c
===================================================================
--- ip6tables.c	(revision 7075)
+++ ip6tables.c	(working copy)
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-17 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17 15:06 [PATCH iptables] print warnings to stderr Max Kellermann

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).