Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 1998 08:43:22 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Don Lewis <Don.Lewis@tsc.tdk.com>
Cc:        Kris Kennaway <kkennawa@physics.adelaide.edu.au>, wollman@khavrinen.lcs.mit.edu, current@FreeBSD.ORG
Subject:   Re: nestea v2 against freebsd 3.0-Release (fwd)
Message-ID:  <Pine.BSF.4.01.9810260840420.366-100000@herring.nlsystems.com>
In-Reply-To: <199810260715.XAA26243@salsa.gv.tsc.tdk.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 25 Oct 1998, Don Lewis wrote:

> Lets say we start off with fp->ipq_frags pointing to the list:
> 
>    fp->ipq_frags => frag1(offset 0) => frag2(offset 6) => NULL
> 
> and we receive a new fragment with offset 0 that overlaps both
> frag1 and frag2.
> 
>         /*      
>          * Find a segment which begins after this one does.
>          */             
>         for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt)
>                 if (GETIP(q)->ip_off > ip->ip_off)
>                         break;
>                
> after the above loop, we'll have:
> 
>    fp->ipq_frags => frag1(offset 0) => frag2(offset 6) => NULL
>                     ^                   ^
>                     |                   |
>                     p                   q
> 
> Next, we remove the beginning part of the new fragment that overlaps frag1 if
> any (code not shown).
> 
> Next, we want to throw away any fragments starting at q that are completely
> covered by the new fragment, and if we find a fragment in the list that
> partially overlaps the new fragment, we want to remove data from its beginning
> to remove the overlap.
> 
> [...]
> 
> The 'if (i < GETIP(q)->ip_len)' clause takes care of the partial overlap
> case.
> 
> Using 'p = q, q = nq' in the for loop causes the following to be executed
> at the end of each loop.
> 
> 	m_freem(q);
> 	p = q;
> 	q = nq;
> 
> This means that 'p' references something on the free list.  Also, we
> don't want to change 'p' because that is our insertion point for the
> new fragment.

Thanks for the explanation.  Would you like to commit the patch or shall
I?

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891
					Fax:   +44 181 381 1039


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



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