- if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {\r
- DEBUG ((EFI_D_WARN, "TcpRetransmit: retransmission cancelled "\r
- "because send window too small for TCB %p\n", Tcb));\r
+\r
+ //\r
+ // Handle the Window Retraction if TCP window scale is enabled according to RFC7323:\r
+ // On first retransmission, or if the sequence number is out of\r
+ // window by less than 2^Rcv.Wind.Shift, then do normal\r
+ // retransmission(s) without regard to the receiver window as long\r
+ // as the original segment was in window when it was sent.\r
+ //\r
+ if ((Tcb->SndWndScale != 0) &&\r
+ (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax) || TCP_SEQ_BETWEEN (Tcb->SndWl2 + Tcb->SndWnd, Seq, Tcb->SndWl2 + Tcb->SndWnd + (1 << Tcb->SndWndScale)))) {\r
+ Len = TCP_SUB_SEQ (Tcb->SndNxt, Seq);\r
+ DEBUG (\r
+ (EFI_D_WARN,\r
+ "TcpRetransmit: retransmission without regard to the receiver window for TCB %p\n",\r
+ Tcb)\r
+ );\r
+ \r
+ } else if (TCP_SEQ_GEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {\r
+ Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);\r
+ \r
+ } else {\r
+ DEBUG (\r
+ (EFI_D_WARN,\r
+ "TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",\r
+ Tcb)\r
+ );\r