netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Love <love_phil@emc.com>
To: netdev@vger.kernel.org
Subject: Re: [PATCH] tcp: fix tcp header size miscalculation when window scale is unused
Date: Mon, 25 Aug 2008 09:30:13 -0700	[thread overview]
Message-ID: <48B2DE15.70708@emc.com> (raw)
In-Reply-To: <20080824.174544.244704849.davem@davemloft.net>

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;


  reply	other threads:[~2008-08-25 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-23 17:18 [PATCH] tcp: fix tcp header size miscalculation when window scale is unused Philip Love
2008-08-23 17:20 ` Adam Langley
2008-08-24  4:40 ` David Miller
2008-08-24 17:40   ` Adam Langley
2008-08-25  0:45     ` David Miller
2008-08-25 16:30       ` Phil Love [this message]
2008-08-25 21:07         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B2DE15.70708@emc.com \
    --to=love_phil@emc.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).