Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Oct 1998 06:36:43 -0800
From:      David Greenman <dg@root.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Potential problem with network drivers in promisc mode 
Message-ID:  <199810271436.GAA12629@implode.root.com>
In-Reply-To: Your message of "Tue, 27 Oct 1998 13:19:28 %2B0100." <199810271219.NAA03999@labinfo.iet.unipi.it> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> > * disable RUNT reception when in promisc mode (I am not sure if this
>> >   is a standard bpf option, or just happens to be implemented in the
>> >   "ed" driver for convenience);
>> 
>>    I haven't verified this with the NIC spec, but I don't think it will ever
>> pass packets that are smaller than 14 bytes since the packets must still
>> conform to the 802.3 spec.
>
>it does... i am seeing 4, 5, 7 byte-packets (including CRC) all
>the time here after the fix for packet-lenght computation in the
>"ed" driver (i am not sure why i never saw less then 4, but perhaps the
>NIC at least wants enough to have a CRC to compare to.)
>And for the records, both the lenght in the NIC packet header and
>the length computed by considering the pointer to the next packet
>are consistent.
>
>>    Still, I think it would be best to check the length and drop the packet
>> if it is less than 14 bytes. I don't think it is wise to always believe what
>> the hardware tells you. I do the check in the fxp driver, but I see that
>> this is an exception for FreeBSD drivers.
>
>the question is what to do with packets between 14 and 60 bytes:
>do you think the higher level code will check for short pkts or assumes
>that a packet with type 0x800 will have for sure an IP header ?

   ip_input() is smart about doing consistency checks. It checks the length
and many other things, so this will not be a problem.

-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810271436.GAA12629>