tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/39203 CVS commit: src/sys/net



On Fri, Jul 25, 2008 at 09:32:13PM +0200, Martin Husemann wrote:
> On Fri, Jul 25, 2008 at 09:11:31PM +0200, Quentin Garnier wrote:
> > How can the driver tell if a frame was truncated or not, if the hardware
> > doesn't indicate it?  I'm pretty sure I saw it with sip(4), but it might
> > have been another.
> 
> By checking the size, unless it knows the hardare can reliably receive
> larger frames (or will tell it about truncation). This is just moving
> the check.

No, it can't tell if the frame was truncated.  That's not what that
check does.  There is no payload length information in the Ethernet
header, so you can only tell if a frame is truncated by checking the
FCS (if you happen to have it) or by inspecting the contents of the
payload.  Either way it's expensive so there's no point in doing it.

> > It relates because the check is about whether or not the system *should*
> > have received such a packet, not whether or not it was able to (rather
> > obviously it was able to receive it).
> 
> I'm not sure I follow how a (broken) pppoe peer means the system should
> have been able to receive the packet. How do we know the frame is not
> truncated?

You have a point.  The PPPoE peer is broken but it's the kind of
brokenness you really want in a PPPoE peer :-)  [Well, at least in an
environment where the ISP only sees PPPoA because the telephony operator
has an Ethernet-ATM bridge and the ISP can't tell if a client is oE or
oA, and thus cannot lower the MTU on the PPP session server because it
would be unfair to all oA users.  That happened to be my situation at
the time, I don't know if it exactly matches Ripke's.]

The check is not very good anyway:  even if we consider only the VLAN
case, it will let packet through whether or not the system plays with
VLANs or not.  There are other situations where it doesn't really make
sense, too.

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpFLSIizrIGp.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index