From owner-freebsd-hackers Tue Oct 27 06:36:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA23026 for freebsd-hackers-outgoing; Tue, 27 Oct 1998 06:36:49 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA23021 for ; Tue, 27 Oct 1998 06:36:47 -0800 (PST) (envelope-from xroot@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id GAA12629; Tue, 27 Oct 1998 06:36:43 -0800 (PST) Message-Id: <199810271436.GAA12629@implode.root.com> To: Luigi Rizzo cc: hackers@FreeBSD.ORG Subject: Re: Potential problem with network drivers in promisc mode In-reply-to: Your message of "Tue, 27 Oct 1998 13:19:28 +0100." <199810271219.NAA03999@labinfo.iet.unipi.it> From: David Greenman Reply-To: dg@root.com Date: Tue, 27 Oct 1998 06:36:43 -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> > * 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