netdev
[Top] [All Lists]

Re: [PATCH] Fix outgoing MSS computation in 2.4 -- with correct patch

To: netdev@xxxxxxxxxxx
Subject: Re: [PATCH] Fix outgoing MSS computation in 2.4 -- with correct patch
From: Andi Kleen <ak@xxxxxxx>
Date: Thu, 7 Feb 2002 02:35:34 +0100
In-reply-to: <20020207001111.A27375@wotan.suse.de>
References: <20020207001111.A27375@wotan.suse.de>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.3.22.1i
On Thu, Feb 07, 2002 at 12:11:11AM +0100, Andi Kleen wrote:
> 
> 2.4 doesn't subtract the timestamp length from the MSS for outgoing
> connects. This causes many problems from hosts on a network connection
> with an MTU < ethernet talking to path mtu blackholed (=behind 
> a firewall that blocks all ICMPs) windows boxes. 
> 
> This patch fixes the problem. 

Arnaldo pointed out that the patch I sent was against 2.5, not 2.4.
Here is the correct patch for 2.4. 

-Andi


--- linux-work/net/ipv4/tcp_output.c-TCPFIX     Tue Feb  5 01:24:27 2002
+++ linux-work/net/ipv4/tcp_output.c    Tue Feb  5 01:58:39 2002
@@ -86,14 +86,14 @@
 {
        struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
        struct dst_entry *dst = __sk_dst_get(sk);
-       int mss = tp->advmss;
 
-       if (dst && dst->advmss < mss) {
-               mss = dst->advmss;
-               tp->advmss = mss;
-       }
+       if (dst && dst->advmss < tp->advmss)
+               tp->advmss = dst->advmss;
 
-       return (__u16)mss;
+       if (sysctl_tcp_timestamps)
+               tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; 
+
+       return (__u16)tp->advmss;;
 }
 
 /* RFC2861. Reset CWND after idle period longer RTO to "restart window".

<Prev in Thread] Current Thread [Next in Thread>