]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Fix bug in TCP which not sending out ACK in certain circumstance.
authorFu Siyuan <siyuan.fu@intel.com>
Fri, 8 Jul 2016 03:59:13 +0000 (11:59 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Mon, 18 Jul 2016 02:08:35 +0000 (10:08 +0800)
Consider the situation as shown in below chart. The last ACK message has
acknowledged the Tcb->RcvWl2, and all the segments until Tcb->RcvNxt have
been received by TCP driver. The Tcb->RcvNxt is not acknowledged due to the
delayed ACK. In this case an incoming segment (Seg->Seq, Seg->End) should
not be accepted by TCP driver, and an immediate ACK is required.

Current TcpSeqAcceptable() thought it’s an acceptable segment incorrectly, it
continues the TcpInput() process instead of sending out an ACK and droping the
segment immediately.

Tcb->RcvWl2                       Tcb->RcvNxt        Tcb->RcvWl2 + Tcb->RcvWnd
        Seg->Seq       Seg->End         |                          |
    |     |               |             |                          |
 ---+-----+---------------+-------------+--------------------------+-----------
           <income segment>             <----Acceptable Range--- -->

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Eugene Cohen <eugene@hp.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-By: Ye Ting <ting.ye@intel.com>
NetworkPkg/TcpDxe/TcpInput.c

index 745ee4cc6e9990f800550666e7af98bbaac8735a..28bb021d7eef10c026e5e0ce9d1b058c3c526448 100644 (file)
@@ -31,7 +31,7 @@ TcpSeqAcceptable (
   IN TCP_SEG *Seg\r
   )\r
 {\r
-  return (TCP_SEQ_LEQ (Tcb->RcvWl2, Seg->End) &&\r
+  return (TCP_SEQ_LEQ (Tcb->RcvNxt, Seg->End) &&\r
           TCP_SEQ_LT (Seg->Seq, Tcb->RcvWl2 + Tcb->RcvWnd));\r
 }\r
 \r