]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Save initial TSVal from TCP connection initiation packets.
authorBALATON Zoltan <balaton@eik.bme.hu>
Mon, 13 Apr 2015 01:39:29 +0000 (01:39 +0000)
committersfu5 <sfu5@Edk2>
Mon, 13 Apr 2015 01:39:29 +0000 (01:39 +0000)
RFC1323 says the most recently received TSVal must be echoed in TSecr in ACK packets
which was not done at first connection because the code saving the TSVal from the peer
was skipped at this point. This resulted in sending an ACK reply with a 0 TSecr that
was rejected at least by FreeBSD. This patch fixes this by updating the saved TSVal
also for connection initiation packets.
Thanks to Laszlo Ersek for analysis and help in debugging.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17165 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
NetworkPkg/TcpDxe/TcpMisc.c

index 3702bead50d8f04c59cd3ec124a456221372e5ab..95f47f91bc40b41c2474480e858ae91ca2a3ee81 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Misc support routines for tcp.\r
 \r
-Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -157,6 +157,8 @@ TcpInitTcbPeer (
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_TS);\r
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RCVD_TS);\r
 \r
+    Tcb->TsRecent = Opt->TSVal;\r
+\r
     //\r
     // Compute the effective SndMss per RFC1122\r
     // section 4.2.2.6. If timestamp option is\r
index 0a4eda37c892225380be1fb753e5fd9ceb269340..40962528884b573786b51e77b43513931f8334ec 100644 (file)
@@ -2,7 +2,7 @@
   Misc support routines for TCP driver.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -161,6 +161,8 @@ TcpInitTcbPeer (
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_TS);\r
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RCVD_TS);\r
 \r
+    Tcb->TsRecent = Opt->TSVal;\r
+\r
     //\r
     // Compute the effective SndMss per RFC1122\r
     // section 4.2.2.6. If timestamp option is\r