From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 26 23:40:07 2004 Return-Path: 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 54EDD16A4CF for ; Mon, 26 Apr 2004 23:40:07 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19D6243D60 for ; Mon, 26 Apr 2004 23:40:07 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3R6e6ZC055792 for ; Mon, 26 Apr 2004 23:40:06 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i3R6e6Xt055791; Mon, 26 Apr 2004 23:40:06 -0700 (PDT) (envelope-from gnats) Date: Mon, 26 Apr 2004 23:40:06 -0700 (PDT) Message-Id: <200404270640.i3R6e6Xt055791@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Gleb Smirnoff Subject: Re: kern/63317: make ng_ether(4) support "lower" and "orphans"simultaneously X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Gleb Smirnoff List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2004 06:40:07 -0000 The following reply was made to PR kern/63317; it has been noted by GNATS. From: Gleb Smirnoff To: Archie Cobbs Cc: Maxim Konovalov , bzeeb-lists@lists.zabbadoz.net, FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/63317: make ng_ether(4) support "lower" and "orphans"simultaneously Date: Tue, 27 Apr 2004 10:33:34 +0400 On Mon, Apr 26, 2004 at 04:49:48PM -0500, Archie Cobbs wrote: A> Gleb Smirnoff wrote: A> > A> Let me be more specific. Suppose both lower and orphans are connected. A> > A> A packet is received from the Ethernet hardware with ethertype A> > A> 0x1234 (i.e., unrecognized). Which hook(s) (lower and/or orphans) A> > A> does that packet get written to? A> > A> > It'll be written to orphans surely. A> A> OK, then this is a change in semantics: whereas before, connecting A> to lower meant always getting all packets, now connecting to lower A> means always getting all packets UNLESS somebody else is connected A> to orphans... could be a completely different and unknown process. It is said in current manpage, that ng_ether sends all packets to lower, however code reveals the truth. Here is a sniplet from ng_ether_input_orphan(), which is a hook called by ethernet stack: /* If "orphan" hook not connected, let packet continue */ if (priv->lower == NULL || !priv->lowerOrphan) { m_freem(m); return; } To make sure, I've made an experiment. I have a notebook in a network where many IPX broadcasts live. So I typed: + mkpeer fxp0: etf lower downstream + name fxp0:lower etf + connect etf: dummy ipx + msg etf: setfilter { matchhook="ipx" ethertype=0x8137 } I've waited for half a minute, and no packets arrived. Then, I've typed: + shutdown etf: + shutdown fxp0: + mkpeer fxp0: etf orphans downstream + name fxp0:orphans etf + connect etf: dummy ipx + msg etf: setfilter { matchhook="ipx" ethertype=0x8137 } And I began receiving packets on dummy. A> To preserve the existing behavior, the node would need to duplicate A> the orphanable packets and send them to BOTH connected hooks. So behavior didn't change. Even we have found some inexactitude in manpage. A> Also, will this change cause packets to go up into the protocol A> stack that previously would not have? E.g., before, if lower were A> connected, then no packets ever reach the protocol stack... is that A> still going to be true? Yes, since "orphaned" packets won't reach it anyway. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE