From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 28 02:20:17 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 0B71716A4CE for ; Wed, 28 Apr 2004 02:20:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E090E43D5F for ; Wed, 28 Apr 2004 02:20:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3S9KGda059987 for ; Wed, 28 Apr 2004 02:20:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i3S9KGPM059986; Wed, 28 Apr 2004 02:20:16 -0700 (PDT) (envelope-from gnats) Date: Wed, 28 Apr 2004 02:20:16 -0700 (PDT) Message-Id: <200404280920.i3S9KGPM059986@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 09:20:17 -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 13:13:41 +0400 On Mon, Apr 26, 2004 at 04:49:48PM -0500, Archie Cobbs wrote: A> To preserve the existing behavior, the node would need to duplicate A> the orphanable packets and send them to BOTH connected hooks. I have spent some time drawing relationship between if_ethersubr.c and ng_ether.c. Now, I have pointed out, that new node will preserve an old behavior in case of 'lower' or 'orphans' connected one at a time. In case of both 'lower' and 'orphans' hooks connected, the node will write ALL packets to 'lower', and no packets to 'orphans'. This may seem useless. However, packets received on 'upper' will travel to upper protocol stack, and those unrecognized will return on 'orphans'. This is useful when someone needs to sniff IP traffic into netgraph and use some "orphan" etherproto on the same interface. For example I use it for serving PPPoE, and counting raw IP traffic on the same interface. In this case a ng_tee node is put on top of ng_ether, connecting its 'lower' and 'upper' together. And you get IP traffic on tee's hooks, and orphaned packet on 'orphans'. Here is some ASCII art: ether stack . ng_ether . netgraph . . . . ether_input() . ,-- ng_ether_rcvdata() <------------ 'upper' -<--, |\ ./ . \ ng_tee | \ / . / | '---/----> ng_ether_input() --------------> 'lower' -->-` | / . . | / . . | / . . v v . . ether_demux()-----> ng_ether_input_orphan() -------> 'orphans' | . . v upper stacks -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE