From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 26 22:32:53 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF0E216A40F for ; Mon, 26 Jun 2006 22:32:52 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BFE343D68 for ; Mon, 26 Jun 2006 22:31:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5QMUReH093898 for ; Mon, 26 Jun 2006 22:30:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5QMURGR093897; Mon, 26 Jun 2006 22:30:27 GMT (envelope-from gnats) Resent-Date: Mon, 26 Jun 2006 22:30:27 GMT Resent-Message-Id: <200606262230.k5QMURGR093897@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Craig Leres Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2802116A404 for ; Mon, 26 Jun 2006 22:24:19 +0000 (UTC) (envelope-from leres@ee.lbl.gov) Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89DD844810 for ; Mon, 26 Jun 2006 22:24:11 +0000 (GMT) (envelope-from leres@ee.lbl.gov) Received: from fun.ee.lbl.gov (localhost [127.0.0.1]) by fun.ee.lbl.gov (8.13.7/8.13.7) with ESMTP id k5QMOBos015436 for ; Mon, 26 Jun 2006 15:24:11 -0700 (PDT) Received: from fun.ee.lbl.gov (leres@localhost) by fun.ee.lbl.gov (8.13.7/8.13.7/Submit) with ESMTP id k5QMOBgT015433 for ; Mon, 26 Jun 2006 15:24:11 -0700 (PDT) Message-Id: <200606262224.k5QMOBgT015433@fun.ee.lbl.gov> Date: Mon, 26 Jun 2006 15:24:11 -0700 From: Craig Leres To: To: ; X-Send-Pr-Version: 3.113 Cc: Subject: kern/99500: [netgraph] [patch] netgraph doesn't honor the monitor interface flag X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2006 22:32:53 -0000 >Number: 99500 >Category: kern >Synopsis: [netgraph] [patch] netgraph doesn't honor the monitor interface flag >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 26 22:30:26 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Craig Leres >Release: FreeBSD 6.1-RELEASE i386 >Organization: Lawrence Berkeley National Laboratory >Environment: fox 128 % uname -a FreeBSD fox.ee.lbl.gov 6.1-RELEASE FreeBSD 6.1-RELEASE #3: Tue Jun 20 11:50:33 PDT 2006 leres@fox.ee.lbl.gov:/usr/src/6.1-RELEASE/sys/i386/compile/LBLSMP i386 >Description: When using netgraph to "bond" two syskonnect gige interfaces together for a packet capture application, we see output errors on the pseudo interface that is the sum of the number of packets input on the two syskonnect NICs. Examination of the code reveals that this is because the packets cannot be transmitted out the pseudo interface. >How-To-Repeat: This is our setup: kldload ng_ether ifconfig sk0 promisc -arp up ifconfig sk1 promisc -arp up ngctl mkpeer . eiface hook ether ngctl mkpeer ngeth0: one2many lower one ngctl connect sk0: ngeth0:lower lower many0 ngctl connect sk1: ngeth0:lower lower many1 ifconfig ngeth0 -arp monitor up >Fix: The appended patch causes netgraph to check the monitor bit and discard the packet if it's set; it also increments the input packet counter (which perhaps it should always do?) I suspect there are other places in netgraph where this should be done. =================================================================== RCS file: netgraph/RCS/ng_eiface.c,v retrieving revision 1.1 diff -c -r1.1 netgraph/ng_eiface.c *** netgraph/ng_eiface.c 2006/06/26 21:56:36 1.1 --- netgraph/ng_eiface.c 2006/06/26 22:14:40 *************** *** 25,31 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.32.2.4 2006/02/14 06:21:47 ru Exp $ */ #include --- 25,31 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.32.2.4+ 2006/02/14 06:21:47 ru Exp $ */ #include *************** *** 233,238 **** --- 233,244 ---- * XXX is this safe? locking? */ BPF_MTAP(ifp, m); + + if (ifp->if_flags & IFF_MONITOR) { + ifp->if_ipackets++; + m_freem(m); + continue; + } /* * Send packet; if hook is not connected, mbuf will get >Release-Note: >Audit-Trail: >Unformatted: