patch-1.3.37 linux/net/ipv4/tcp.c

Next file: linux/net/ipv4/udp.c
Previous file: linux/net/ipv4/route.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.36/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
@@ -174,7 +174,8 @@
  *					change. Doesn't yet cope with MSS shrink right
  *					but its a start!
  *		Marc Tamsky	:	Closing in closing fixes.
- *		Mike Shaver	:	RFC1122 verifications
+ *		Mike Shaver	:	RFC1122 verifications.
+ *		Alan Cox	:	rcv_saddr errors.
  *
  *
  * To Fix:
@@ -1816,7 +1817,6 @@
 					from += copy;
 					copied += copy;
 					len -= copy;
-					seglen -= copy;
 					sk->write_seq += copy;
 					seglen -= copy;
 				}
@@ -3053,6 +3053,7 @@
 	 
 	newsk->daddr = saddr;
 	newsk->saddr = daddr;
+	newsk->rcv_saddr = daddr;
 
 	put_sock(newsk->num,newsk);
 	newsk->dummy_th.res1 = 0;
@@ -4575,7 +4576,7 @@
 	
 
 	/*
-	 *	Put in the IP header and routing stuff. 
+	 *	Put in the IP header and routing stuff.
 	 */
 	 
 	if (sk->localroute)
@@ -4583,6 +4584,12 @@
 	else
 	  rt=ip_rt_route(sk->daddr, NULL, sk->saddr ? NULL : &sk->saddr);
 
+	/*
+	 *	When we connect we enforce receive requirements too.
+	 */
+	 
+	sk->rcv_saddr=sk->saddr;
+	
 	/*
 	 *	We need to build the routing stuff from the things saved in skb. 
 	 */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this