From owner-freebsd-pf@FreeBSD.ORG Mon Oct 4 07:45:57 2004 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C835216A4CF for ; Mon, 4 Oct 2004 07:45:57 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E8D643D45 for ; Mon, 4 Oct 2004 07:45:57 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i947inAh047953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 4 Oct 2004 16:44:49 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) by michelle.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i947jrAL001649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 4 Oct 2004 16:45:53 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.12.10/8.12.10/Submit) id i947jrtH001648 for freebsd-pf@freebsd.org; Mon, 4 Oct 2004 16:45:53 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Mon, 4 Oct 2004 16:45:53 +0900 From: Pyun YongHyeon To: freebsd-pf@freebsd.org Message-ID: <20041004074553.GB1226@kt-is.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) Subject: Shutting down pflogd gracefully X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Technical discussion and general questions about packet filter (pf) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 07:45:57 -0000 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