Subject: Re: Allowing large PPPoE frames
To: Quentin Garnier <netbsd@quatriemek.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-net
Date: 08/04/2003 11:08:52
On Sun, Aug 03, 2003 at 09:31:44PM +0200, Quentin Garnier wrote:
> Well, at the time that particular check is done, VLAN capabilities aren't
> checked for the interface either: if a frame *may* have a VLAN tag (i.e.,
> its Ethernet type field is set to ETHERTYPE_VLAN), it gets processed. My
> patch just does the same thing for PPPoE

At the place ETHER_MAX_FRAME() is used, yes. But it's not the only place
where the frame length may be checked. For example, look at the use of
ETHERCAP_VLAN_MTU in sys/dev/ic/tulip.c, or lance.c, or a few others that
also enforce the len in hardware.

> 
> The PPPoE client code will do the necessary sanity checks and decide if it
> is a valid PPPoE frame. The patch just gives a chance for the frame to be
> processed, asserting it is a valid one is the responsibility of the PPPoE
> code.
> 
> I don't see how this is different from the way VLAN frames are processed,
> and why large PPPoE frames should be handled differently.

It's not different. For now you are missing bits to have the PPPoE frames
handled properly by some drivers.

> 
> At the time the check is done, the only question asked is "given that
> frame is too large WRT Ethernet specification, is there a chance it might
> still be of interest for us?".
> 
> About the NIC driver issue, it is very hardware-dependant. The card I have
> on my NetBSD 1.5 gateway is a unbranded rt8029 PCI card, and I nothing to
> do to make it accept large PPPoE frames. It may not be true for all NE2000
> clones...
> 
> For the DP83815, the following one-liner is needed. I haven't tested on
> any other NIC I might have.

This one needs the ETHERCAP_PPPOE_MTU ec_capenable, for exemple.

> 
> But anyway, we don't have to check if the NIC can receive the frame at
> that time, because obviously it could.

ec_capenable ETHERCAP_VLAN_MTU is there to have the driver allow the nic to
receive such frames. 

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--