[conntrack-tools] log: syslog displays the entry that triggers the error

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Thu Jul 24 09:28:47 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=f52bcb906ba05f67a0a54dfeb9abff0ba6a02c89
commit f52bcb906ba05f67a0a54dfeb9abff0ba6a02c89
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Thu Jul 24 09:28:32 2008 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Thu Jul 24 09:28:32 2008 +0200

    log: syslog displays the entry that triggers the error
    
    This patch fixes an inconsistency in the output. If syslog was chosen as
    logger, the conntrack entries that triggered an error were not
    displayed.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  f52bcb906ba05f67a0a54dfeb9abff0ba6a02c89 (commit)
      from  167a57cb822eb6ce3759f5de3a11c59849b494e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f52bcb906ba05f67a0a54dfeb9abff0ba6a02c89
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Thu Jul 24 09:28:32 2008 +0200

    log: syslog displays the entry that triggers the error
    
    This patch fixes an inconsistency in the output. If syslog was chosen as
    logger, the conntrack entries that triggered an error were not
    displayed.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 src/log.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
This patch fixes an inconsistency in the output. If syslog was chosen as
logger, the conntrack entries that triggered an error were not
displayed.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/src/log.c b/src/log.c
index d97a69f..9fe5119 100644
--- a/src/log.c
+++ b/src/log.c
@@ -134,8 +134,15 @@ void dlog_ct(FILE *fd, struct nf_conntrack *ct, unsigned int type)
 		fputs(buf, fd);
 	}
 
-	if (CONFIG(stats).syslog_facility != -1)
-		syslog(LOG_INFO, "%s", tmp);
+	if (fd == STATE(log)) {
+		/* error reporting */
+		if (CONFIG(syslog_facility) != -1)
+			syslog(LOG_ERR, "%s", tmp);
+	} else if (fd == STATE(stats_log)) {
+		/* connection logging */
+		if (CONFIG(stats).syslog_facility != -1)
+			syslog(LOG_INFO, "%s", tmp);
+	}
 }
 
 void close_log(void)



More information about the netfilter-cvslog mailing list