From owner-freebsd-net@FreeBSD.ORG Sat Oct 9 08:31:44 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9EBE916A4CE; Sat, 9 Oct 2004 08:31:44 +0000 (GMT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C20443D1D; Sat, 9 Oct 2004 08:31:44 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.8) with ESMTP id i998VioI074047; Sat, 9 Oct 2004 01:31:44 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id i998Vikp074046; Sat, 9 Oct 2004 01:31:44 -0700 (PDT) (envelope-from rizzo) Date: Sat, 9 Oct 2004 01:31:44 -0700 From: Luigi Rizzo To: Gleb Smirnoff , Giorgos Keramidas , freebsd-net@freebsd.org Message-ID: <20041009013144.A73912@xorpc.icir.org> References: <20041008151515.GA3136@orion.daedalusnetworks.priv> <20041008203434.GA2770@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20041008203434.GA2770@cell.sick.ru>; from glebius@freebsd.org on Sat, Oct 09, 2004 at 12:34:34AM +0400 Subject: Re: Calling m_pullup in ether_input X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 08:31:44 -0000 On Sat, Oct 09, 2004 at 12:34:34AM +0400, Gleb Smirnoff wrote: > On Fri, Oct 08, 2004 at 06:15:15PM +0300, Giorgos Keramidas wrote: > G> In ether_input() we unconditionaly discard the mbufs whose m_len is less than > G> ETHER_HDR_LEN. A bit higher M_PKTHDR has been checked but the check made > G> before discarding the frame doesn't pay attention to the m->m_pkthdr.len (the > G> total packet length). > > In my humble opinion, all Ethernet device drivers are intentionally written > in such a way that they always pass an mbuf with contigous Ethernet header > to ether_input(). actually, historically it wasn't always like this, the API for ether_input()used to have the MAC header in a different place, so the code giorgios refers to might be a leftover from older times (still in 4.x) cheers luigi