kern/63317: make ng_ether(4) support "lower" and "orphans"simultaneously

Gleb Smirnoff glebius at cell.sick.ru
Mon Apr 26 23:40:07 PDT 2004


The following reply was made to PR kern/63317; it has been noted by GNATS.

From: Gleb Smirnoff <glebius at cell.sick.ru>
To: Archie Cobbs <archie at dellroad.org>
Cc: Maxim Konovalov <maxim at macomnet.ru>,
	bzeeb-lists at lists.zabbadoz.net, FreeBSD-gnats-submit at 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


More information about the freebsd-bugs mailing list