Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Oct 2004 16:45:53 +0900
From:      Pyun YongHyeon <yongari@kt-is.co.kr>
To:        freebsd-pf@freebsd.org
Subject:   Shutting down pflogd gracefully
Message-ID:  <20041004074553.GB1226@kt-is.co.kr>

next in thread | raw e-mail | index | archive | help
Hi,

When pf module is unloaded prior to termination of pflogd(8),
pflogd(8) takes up all available CPU cycles. This patch tries
to address the long standing issue. Comments?

--- contrib/pf/pflogd/pflogd.c.orig	Wed Sep  1 03:04:34 2004
+++ contrib/pf/pflogd/pflogd.c	Mon Oct  4 16:18:51 2004
@@ -656,8 +656,13 @@
 	while (1) {
 		np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
 		    dump_packet, (u_char *)dpcap);
-		if (np < 0)
+		if (np < 0) {
 			logmsg(LOG_NOTICE, "%s", pcap_geterr(hpcap));
+#ifdef __FreeBSD__
+			/* check errno == ENXIO? */
+			break;
+#endif
+		}
 
 		if (gotsig_close)
 			break;

While fixing the issue, I noticed log messages via syslog is not
gernerated. But in debugging mode(-D) outputting to stderr worked
ok.(Killing pflogd with kill doesn't generate "Exiting" message.)
Any ideas?

Regards,
Pyun YongHyeon
-- 
Pyun YongHyeon <http://www.kr.freebsd.org/~yongari>;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041004074553.GB1226>