Date: Wed, 18 Feb 2004 03:50:20 -0800 (PST) From: Ruslan Ermilov <ru@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/62989: ether_input computes incorrect m_pkthdr.len when mbufs are chained Message-ID: <200402181150.i1IBoKvH048634@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/62989; it has been noted by GNATS. From: Ruslan Ermilov <ru@FreeBSD.org> To: Roselyn Lee <rosel@verniernetworks.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402181150.i1IBoKvH048634>