From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 18 03:50:21 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1352316A4CE for ; Wed, 18 Feb 2004 03:50:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BCDE43D1F for ; Wed, 18 Feb 2004 03:50:21 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1IBoKbv048635 for ; Wed, 18 Feb 2004 03:50:20 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1IBoKvH048634; Wed, 18 Feb 2004 03:50:20 -0800 (PST) (envelope-from gnats) Date: Wed, 18 Feb 2004 03:50:20 -0800 (PST) Message-Id: <200402181150.i1IBoKvH048634@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ruslan Ermilov Subject: Re: kern/62989: ether_input computes incorrect m_pkthdr.len when mbufs are chained X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ruslan Ermilov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 11:50:21 -0000 The following reply was made to PR kern/62989; it has been noted by GNATS. From: Ruslan Ermilov To: Roselyn Lee Cc: bug-followup@FreeBSD.org Subject: Re: kern/62989: ether_input computes incorrect m_pkthdr.len when mbufs are chained Date: Wed, 18 Feb 2004 13:48:59 +0200 On Tue, Feb 17, 2004 at 06:39:09PM -0800, Roselyn Lee wrote: > m_pkthdr.len that is computed by ether_input() incorrectly assumes > m_len is the length of the entire packet. For example, the sis0 > driver could return a list of mbufs to hold an incoming packet when > the system is out of clusters. > Can you please try this patch instead and let me know if it works for you? %%% Index: if_ethersubr.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.70.2.34 diff -u -p -r1.70.2.34 if_ethersubr.c --- if_ethersubr.c 16 Jan 2004 20:01:16 -0000 1.70.2.34 +++ if_ethersubr.c 18 Feb 2004 11:39:37 -0000 @@ -564,9 +564,7 @@ ether_input(struct ifnet *ifp, struct et } m->m_pkthdr.rcvif = ifp; eh = mtod(m, struct ether_header *); - m->m_data += sizeof(struct ether_header); - m->m_len -= sizeof(struct ether_header); - m->m_pkthdr.len = m->m_len; + m_adj(m, sizeof(*eh)); } /* Check for a BPF tap */ %%% Cheers, -- Ruslan Ermilov FreeBSD committer ru@FreeBSD.org