From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 28 09:00:39 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 1B0AE16A4D6 for ; Wed, 28 Apr 2004 09:00:39 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E38543D1D for ; Wed, 28 Apr 2004 09:00:29 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3SG0T4J093724 for ; Wed, 28 Apr 2004 09:00:29 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i3SG0S78093723; Wed, 28 Apr 2004 09:00:28 -0700 (PDT) (envelope-from gnats) Date: Wed, 28 Apr 2004 09:00:28 -0700 (PDT) Message-Id: <200404281600.i3SG0S78093723@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: Wed, 28 Apr 2004 16:00:39 -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: Wed, 28 Apr 2004 19:51:36 +0400 On Wed, Apr 28, 2004 at 10:20:37AM -0500, Archie Cobbs wrote: A> Now we're back to my original question :-) A> A> Ideally I think that we should duplicate packets when both hooks are connected. A> Here's the simple reason why: Today the following statements are true: A> A> 1. If you connect to lower, you get ALL packets A> 2. If you connect to orphans, you get ALL orphan packets A> A> We'd want both statements to continue to be true. Therefore, when both A> lower and orphans are connected, the node must duplicate orphan packets. A> A> Unfortunately doing this is probably tricky because the determination of A> whether a packet is an orphan is done in if_ethersubr.c, not ng_ether.c. A> Same thing applies to your proposal above. Moreover it is not only tricky, it is dangerous. If we use a 'pass thru' node on top of ng_ether, then an orphaned packet goes into infinite loop passing upper,ether_demux(),lower. I have tried it and got a freezed machine :) A> Remember that lower gets packets before they go through ether_demux(), A> while orphans gets them after. So there's two different places where A> packets are intercepted by ng_ether for lower vs. orphans. A> A> So I suggest a simpler (to implement) solution: A> A> - if lower is connected, send ALL packets to it (like now) A> - if orphans is connected send orphaned packets to it (like now) A> - if both are connected, send ALL packets to lower A> A> Note: in case #3 orhan packets written to upper will flow out of the A> orphans hook. So if the node connected to lower is a 'pass thru' to A> upper then the orphans hook will still see orphan packets! A> A> To implement this, we simply remove the restriction that both orpans A> and lower can't be connected at the same time and keep all the existing A> logic the same as it is. Exactly this does the original patch. :) And we should also add to manpage: Packets received on 'upper', and not recognized by upper level stack are send back out of 'orphans' hook if it exists. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE