Date: Sun, 4 Mar 2007 00:53:59 +0300 From: Yar Tikhiy <yar@comp.chem.msu.su> To: Bruce M Simpson <bms@incunabulum.net> Cc: freebsd-net@freebsd.org Subject: Re: [PATCH] Ethernet cleanup; 802.1p input and M_PROMISC Message-ID: <20070303215359.GB40430@comp.chem.msu.su> In-Reply-To: <45E8B964.2090200@incunabulum.net> References: <45E8B964.2090200@incunabulum.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070303215359.GB40430>