summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2007-10-17 16:36:49 +0000
committer/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2007-10-17 16:36:49 +0000
commite92147350c8a17b77173e19d5a8a4c5eacf1e592 (patch)
tree543f70532676d420109cbf734e9e193e39641763
parent3310b0093a5cb7e65b5f667651e8f6e73efc40a2 (diff)
[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@duempel.org>
-rw-r--r--ip6tables.c14
-rw-r--r--iptables.c7
-rw-r--r--xtables.c7
3 files changed, 16 insertions, 12 deletions
diff --git a/ip6tables.c b/ip6tables.c
index f658fc7..938c91e 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -1592,9 +1592,10 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
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 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
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 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
}
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);
diff --git a/iptables.c b/iptables.c
index 25ca358..7096121 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1818,7 +1818,7 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
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 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
}
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);
diff --git a/xtables.c b/xtables.c
index 58b4e81..6107119 100644
--- a/xtables.c
+++ b/xtables.c
@@ -246,9 +246,10 @@ void parse_interface(const char *arg, char *vianame, unsigned char *mask)
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;
}
}