[PATCH] Ethernet cleanup; 802.1p input and M_PROMISC
Yar Tikhiy
yar at comp.chem.msu.su
Sat Mar 3 21:54:02 UTC 2007
On Fri, Mar 02, 2007 at 11:55:16PM +0000, Bruce M Simpson wrote:
> Hello all,
>
> I would like to announce an updated version of the 802.1p input patch,
> available at:
> http://people.freebsd.org/~bms/dump/latest-8021p.diff
>
> I have cut down the original scope of the patch. I previously ran into
> problems when I tried to move VLAN tag input and output processing into
> if_ethersubr.c.
>
> FreeBSD should now accept VLAN 0 traffic on input with this patch. In
> addition to this, the M_PROMISC flag is now used, which considerably
> simplifies the Ethernet input path in general.
[...]
Sorry, I don't have an opportunity to test your patch, but it looks
good to me. It seems to remove some cruft from the code, which is
a good sign! I've got only one question about this piece:
@@ -504,6 +507,10 @@
struct ether_header *eh;
u_short etype;
+ if ((ifp->if_flags & IFF_UP) == 0) {
+ m_freem(m);
+ return;
+ }
In fact, there two independent flags indicating interface's readiness:
IFF_UP and IFF_DRV_RUNNING. The former is controlled by the admin
and the latter, by the driver. E.g., an interface can be UP but
not really ready to operate due to h/w reasons, or vice versa.
Perhaps we should check both flags to see if the interface is, so
to say, up and running. if_vlan.c has an obvious macro for that,
and it can go to if_var.h to avoid code duplication if we decide it's
the right way to take.
--
Yar
More information about the freebsd-net
mailing list