From 3e9d7f26a9b3cf7295655ac4c4fa073165654131 Mon Sep 17 00:00:00 2001
From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Mon, 7 Feb 2005 23:26:04 +0000
Subject: [PATCH] - merge revision 1.13.2.2 date: 2005/02/07 23:05:42;  author:
 mlhuang;  state: Exp;  lines: +10 -3 - PL4167 fix: Transfer ownership of
 reusable TIME_WAIT buckets to   whomever VNET decided should own the packet.

---
 net/ipv4/tcp_ipv4.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 40643a19d..b25b06f72 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_ipv4.c,v 1.240 2002/02/01 22:01:04 davem Exp $
+ * Version:	$Id$
  *
  *		IPv4 specific functions
  *
@@ -1813,9 +1813,16 @@ process:
 	/* Silently drop if VNET is active and the context is not
 	 * entitled to read the packet.
 	 */
-	if (vnet_active &&
-	    (int) sk->sk_xid > 0 && sk->sk_xid != skb->xid)
-		goto discard_it;
+	if (vnet_active) {
+		/* Transfer ownership of reusable TIME_WAIT buckets to
+		 * whomever VNET decided should own the packet.
+		 */
+		if (sk->sk_state == TCP_TIME_WAIT)
+			sk->sk_xid = skb->xid;
+
+		if ((int) sk->sk_xid > 0 && sk->sk_xid != skb->xid)
+			goto discard_it;
+	}
 #endif
 
 	if (sk->sk_state == TCP_TIME_WAIT)
-- 
2.47.0