Subject: Re: pppoe & mbuf chain
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: David Laight <david@l8s.co.uk>
List: tech-net
Date: 06/21/2002 17:13:45
On Fri, Jun 21, 2002 at 11:54:41PM +0900, YAMAMOTO Takashi wrote:
> in-kernel pppoe have an assumption that
> input packets are a single mbuf.
> (ie. no mbuf chain)
> attached diff will fix it.

apart from the obvious bugs!

> +			m = m_pullup(m, m->m_len);
> +			if (m == NULL)
> +				goto drop;
<snip>
> +drop:
> +        m_freem(m);

you want to free the original 'm' which you have carefully
lost!

> +		if ((m = m_pullup(m, PPPOE_HEADERLEN)) == 0)
> +			goto drop;

ditto

	David

-- 
David Laight: david@l8s.co.uk