From a0f802e2ac91f04d7017def663b0bd7040ca9a0c Mon Sep 17 00:00:00 2001 From: yamt Date: Tue, 8 Mar 2005 11:27:14 +0000 Subject: [PATCH] tcp_sack_option: handle the case that the right-most sack'ed block is expanded. a fix from Noritoshi Demizu (FreeBSD PR/78226) via Kentaro A. Kurahone. --- sys/netinet/tcp_sack.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 8b2cab2a252b..5155ed27b9f0 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_sack.c,v 1.7 2005/03/07 10:27:39 yamt Exp $ */ +/* $NetBSD: tcp_sack.c,v 1.8 2005/03/08 11:27:14 yamt Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -109,7 +109,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_sack.c,v 1.7 2005/03/07 10:27:39 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_sack.c,v 1.8 2005/03/08 11:27:14 yamt Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -377,10 +377,12 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) tmp->start = tp->rcv_lastsack; tmp->end = sack->left; tmp->rxmit = tmp->start; - tp->rcv_lastsack = sack->right; TAILQ_INSERT_TAIL(&tp->snd_holes, tmp, sackhole_q); cur = tmp; } + if (SEQ_LT(tp->rcv_lastsack, sack->right)) { + tp->rcv_lastsack = sack->right; + } } }