Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2002 19:30:42 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Bosko Milekic <bmilekic@unixdaemons.com>
Cc:        arch@freebsd.org
Subject:   Re: Trivial mbuf patch for review. 
Message-ID:  <4748.1032370242@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 18 Sep 2002 13:23:00 EDT." <20020918132300.A34069@unixdaemons.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020918132300.A34069@unixdaemons.com>, Bosko Milekic writes:
>>  		panic("sbappendcontrol");
>> -	for (m = control; ; m = m->m_next) {
>> -		space += m->m_len;
>> -		if (m->m_next == 0)
>> -			break;
>> -	}
>> -	n = m;			/* save pointer to last control buffer */
>> -	for (m = m0; m; m = m->m_next)
>> -		space += m->m_len;
>> +	space = m_length(control, &n) + m_length(m0, NULL);
>>  	if (space > sbspace(sb))
>>  		return (0);
>>  	n->m_next = m0;			/* concatenate data to control */
>
>   Looks like there is a problem here, as you removed the 'n = m'
>   initialization.

m_length's returns the pointer to the last mbuf in the chain in
the second argument, so n should have the same value as before.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4748.1032370242>