kern/63317: make ng_ether(4) support "lower" and
"orphans"simultaneously
Gleb Smirnoff
glebius at cell.sick.ru
Wed Apr 28 09:00:39 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: 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
More information about the freebsd-bugs
mailing list