summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conntrack.c7
-rw-r--r--src/main.c2
-rw-r--r--src/read_config_lex.l12
-rw-r--r--src/read_config_yy.y19
4 files changed, 21 insertions, 19 deletions
diff --git a/src/conntrack.c b/src/conntrack.c
index 65dc4a7..fa6ae0a 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -929,8 +929,8 @@ int main(int argc, char *argv[])
l3protonum);
break;
case 'a':
- printf("warning: ignoring --nat-range, "
- "use --src-nat or --dst-nat instead.\n");
+ fprintf(stderr, "warning: ignoring --nat-range, "
+ "use --src-nat or --dst-nat instead.\n");
break;
case 'n':
options |= CT_OPT_SRC_NAT;
@@ -958,7 +958,8 @@ int main(int argc, char *argv[])
nfct_set_attr_u32(obj, ATTR_SECMARK, atol(optarg));
break;
case 'i':
- printf("warning: ignoring --id. deprecated option.\n");
+ fprintf(stderr,
+ "warning: ignoring --id. deprecated option.\n");
break;
case 'f':
options |= CT_OPT_FAMILY;
diff --git a/src/main.c b/src/main.c
index a3164a6..3a54911 100644
--- a/src/main.c
+++ b/src/main.c
@@ -248,7 +248,7 @@ int main(int argc, char *argv[])
*/
STATE(log) = init_log(CONFIG(logfile));
if (config_set && !STATE(log)) {
- fprintf(stdout, "can't open logfile `%s\n'", CONFIG(logfile));
+ fprintf(stderr, "can't open logfile `%s\n'", CONFIG(logfile));
exit(EXIT_FAILURE);
}
diff --git a/src/read_config_lex.l b/src/read_config_lex.l
index 81ae64f..847ec74 100644
--- a/src/read_config_lex.l
+++ b/src/read_config_lex.l
@@ -110,14 +110,14 @@ ftfw [F|f][T|t][F|f][W|w]
{ip6} { yylval.string = strdup(yytext); return T_IP; }
{path} { yylval.string = strdup(yytext); return T_PATH_VAL; }
{alarm} { return T_ALARM; }
-{persistent} { printf("\nWARNING: Now `persistent' mode is called "
- "`alarm'. Please, update "
- "your conntrackd.conf file.\n");
+{persistent} { fprintf(stderr, "\nWARNING: Now `persistent' mode "
+ "is called `alarm'. Please, update "
+ "your conntrackd.conf file.\n");
return T_ALARM; }
{ftfw} { return T_FTFW; }
-{nack} { printf("\nWARNING: Now `nack' mode is called "
- "`ftfw'. Please, update "
- "your conntrackd.conf file.\n");
+{nack} { fprintf(stderr, "\nWARNING: Now `nack' mode "
+ "is called `ftfw'. Please, update "
+ "your conntrackd.conf file.\n");
return T_FTFW; }
{string} { yylval.string = strdup(yytext); return T_STRING; }
diff --git a/src/read_config_yy.y b/src/read_config_yy.y
index 6201923..92806f8 100644
--- a/src/read_config_yy.y
+++ b/src/read_config_yy.y
@@ -119,7 +119,8 @@ syslog_facility : T_SYSLOG T_STRING
else if (!strcmp($2, "local7"))
conf.syslog_facility = LOG_LOCAL7;
else {
- fprintf(stderr, "'%s' is not a known syslog facility, ignoring.\n", $2);
+ fprintf(stderr, "'%s' is not a known syslog facility, "
+ "ignoring.\n", $2);
return;
}
};
@@ -180,24 +181,24 @@ ignore_traffic_option : T_IPV4_ADDR T_IP
#endif
if (!family) {
- fprintf(stdout, "%s is not a valid IP, ignoring", $2);
+ fprintf(stderr, "%s is not a valid IP, ignoring", $2);
return;
}
if (!STATE(ignore_pool)) {
STATE(ignore_pool) = ignore_pool_create(family);
if (!STATE(ignore_pool)) {
- fprintf(stdout, "Can't create ignore pool!\n");
+ fprintf(stderr, "Can't create ignore pool!\n");
exit(EXIT_FAILURE);
}
}
if (!ignore_pool_add(STATE(ignore_pool), &ip)) {
if (errno == EEXIST)
- fprintf(stdout, "IP %s is repeated "
+ fprintf(stderr, "IP %s is repeated "
"in the ignore pool\n", $2);
if (errno == ENOSPC)
- fprintf(stdout, "Too many IP in the ignore pool!\n");
+ fprintf(stderr, "Too many IP in the ignore pool!\n");
}
};
@@ -327,7 +328,7 @@ ignore_proto: T_NUMBER
if ($1 < IPPROTO_MAX)
conf.ignore_protocol[$1] = 1;
else
- fprintf(stdout, "Protocol number `%d' is freak\n", $1);
+ fprintf(stderr, "Protocol number `%d' is freak\n", $1);
};
ignore_proto: T_UDP
@@ -563,8 +564,8 @@ stat_line:
int
yyerror(char *msg)
{
- printf("Error parsing config file: ");
- printf("line (%d), symbol '%s': %s\n", yylineno, yytext, msg);
+ fprintf(stderr, "Error parsing config file: ");
+ fprintf(stderr, "line (%d), symbol '%s': %s\n", yylineno, yytext, msg);
exit(EXIT_FAILURE);
}
@@ -611,7 +612,7 @@ init_config(char *filename)
if (!STATE(ignore_pool)) {
STATE(ignore_pool) = ignore_pool_create(CONFIG(family));
if (!STATE(ignore_pool)) {
- fprintf(stdout, "Can't create ignore pool!\n");
+ fprintf(stderr, "Can't create ignore pool!\n");
exit(EXIT_FAILURE);
}
}