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

Archie Cobbs archie at dellroad.org
Tue Apr 27 08:00:26 PDT 2004


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

From: Archie Cobbs <archie at dellroad.org>
To: Gleb Smirnoff <glebius at cell.sick.ru>
Cc: Archie Cobbs <archie at dellroad.org>,
	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 09:18:58 -0500 (CDT)

 Gleb Smirnoff wrote:
 > 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;
 >         }
 
 What is your point? This function is only called for orphan packets.
 In the current code, if the 'lower' hook is connected, this function will
 never be called (all packets will get sent to 'lower') (note: in the current
 code, 'priv->lower' is used for both 'lower' and 'orphans' hooks).
 
 > 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:
 
 Is this with your modified node? If so, then it demonstrates how you have
 changed the semantics.
 
 You should see ALL packets on the 'lower' hook. This has been working fine
 for years in the current code.
 
 Try a simpler experiment: "connect fxp0: dummy lower" and you should
 see ALL packets, including IPX packets.
 
 > 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.
 
 The current behavior is: if node X is connected to 'lower', then
 ALL packets received from the hardware are delivered to node X.
 It appears you have changed this (?)
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


More information about the freebsd-bugs mailing list