1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-04 12:52:15 +00:00

Allow a 1000 fragment sliding window when placing a new fragment

in our inbound multilnk queue.  This fixes wrapping problems when
something arrives out-of-sequence.
This commit is contained in:
Brian Somers 1998-05-04 21:42:41 +00:00
parent 59acc91778
commit 1bcced10ad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=35718

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp.c,v 1.1.2.21 1998/05/03 22:13:12 brian Exp $
* $Id: mp.c,v 1.1.2.22 1998/05/04 03:00:08 brian Exp $
*/
#include <sys/types.h>
@ -105,6 +105,13 @@ inc_seq(unsigned is12bit, u_int32_t seq)
return seq;
}
static int
isbefore(unsigned is12bit, u_int32_t seq1, u_int32_t seq2)
{
u_int32_t max = is12bit ? 0xfff : 0xffffff;
return seq1 < seq2 || (seq1 > max - 0x200 && seq2 <= 0x200);
}
static int
mp_ReadHeader(struct mp *mp, struct mbuf *m, struct mp_header *header)
{
@ -342,7 +349,7 @@ mp_Input(struct mp *mp, struct mbuf *m, struct physical *p)
q = mp->inbufs;
while (q) {
mp_ReadHeader(mp, q, &h);
if (m && h.seq > mh.seq) {
if (m && isbefore(mp->local_is12bit, mh.seq, h.seq)) {
/* Our received fragment fits in before this one, so link it in */
if (last)
last->pnext = m;
@ -473,7 +480,7 @@ mp_Input(struct mp *mp, struct mbuf *m, struct physical *p)
last = NULL;
for (q = mp->inbufs; q; last = q, q = q->pnext) {
mp_ReadHeader(mp, q, &h);
if (h.seq > mh.seq)
if (isbefore(mp->local_is12bit, mh.seq, h.seq))
break;
}
/* Our received fragment fits in here */