Re: [PATCH] tcp: fix tcp header size miscalculation when window scale is unused

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Phil Love
Date: Monday, August 25, 2008 - 9:30 am

Here is the patch using Thunderbird, rather than Apple Mail. Hopefully 
it is not mangled this time.

Signed-off-by: Philip Love <love_phil@emc.com>

--- a/net/ipv4/tcp_output.c	2008-08-24 07:44:18.000000000 -0700
+++ b/net/ipv4/tcp_output.c	2008-08-24 07:43:05.000000000 -0700
@@ -468,7 +468,8 @@ static unsigned tcp_syn_options(struct s
  	}
  	if (likely(sysctl_tcp_window_scaling)) {
  		opts->ws = tp->rx_opt.rcv_wscale;
-		size += TCPOLEN_WSCALE_ALIGNED;
+		if(likely(opts->ws))
+			size += TCPOLEN_WSCALE_ALIGNED;
  	}
  	if (likely(sysctl_tcp_sack)) {
  		opts->options |= OPTION_SACK_ADVERTISE;
@@ -509,7 +510,8 @@ static unsigned tcp_synack_options(struc

  	if (likely(ireq->wscale_ok)) {
  		opts->ws = ireq->rcv_wscale;
-		size += TCPOLEN_WSCALE_ALIGNED;
+		if(likely(opts->ws))
+			size += TCPOLEN_WSCALE_ALIGNED;
  	}
  	if (likely(doing_ts)) {
  		opts->options |= OPTION_TS;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] tcp: fix tcp header size miscalculation when w ..., Phil Love, (Mon Aug 25, 9:30 am)