netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fan Du <fan.du@intel.com>
To: johnwheffner@gmail.com
Cc: davem@davemloft.net, netdev@vger.kernel.org, fengyuleidian0615@gmail.com
Subject: [PATCH net-next 2/4] ipv4: Correct two conditions checking when buildig nskb
Date: Tue, 10 Mar 2015 17:16:24 +0800	[thread overview]
Message-ID: <1425978986-8512-3-git-send-email-fan.du@intel.com> (raw)
In-Reply-To: <1425978986-8512-1-git-send-email-fan.du@intel.com>

When traversing write queue to build 'nskb', the size of 'copy'
could only be equal or smaller than skb->len.

And as we need exactly 'probe_size' bytes data for 'nskb', thus
break condition could only be len == probe_size.

Signed-off-by: Fan Du <fan.du@intel.com>
---
 net/ipv4/tcp_output.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5a73ad5..79977d1 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1954,7 +1954,7 @@ static int tcp_mtu_probe(struct sock *sk)
 							    skb_put(nskb, copy),
 							    copy, nskb->csum);
 
-		if (skb->len <= copy) {
+		if (skb->len == copy) {
 			/* We've eaten all the data from this skb.
 			 * Throw it away. */
 			TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags;
@@ -1977,7 +1977,7 @@ static int tcp_mtu_probe(struct sock *sk)
 
 		len += copy;
 
-		if (len >= probe_size)
+		if (len == probe_size)
 			break;
 	}
 	tcp_init_tso_segs(sk, nskb, nskb->len);
-- 
1.7.1

  parent reply	other threads:[~2015-03-10  9:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  9:16 [PATCH net-next 0/4] Fix for TCP PMTU Fan Du
2015-03-10  9:16 ` [PATCH net-next 1/4] ipv4: Rename tcp_mtu_probing to tcp_blackhole_probe Fan Du
2015-03-10  9:16 ` Fan Du [this message]
2015-03-18 12:44   ` [PATCH net-next 2/4] ipv4: Correct two conditions checking when buildig nskb John Heffner
2015-03-10  9:16 ` [PATCH net-next 3/4] ipv4: Use probe_size to check write queue data length Fan Du
2015-03-10 12:26   ` John Heffner
2015-03-18  1:37     ` Fan Du
2015-03-18 12:41       ` John Heffner
2015-03-10  9:16 ` [PATCH net-next 4/4] ipv4: clamp sysctl_tcp_probe_threshold Fan Du

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=1425978986-8512-3-git-send-email-fan.du@intel.com \
    --to=fan.du@intel.com \
    --cc=davem@davemloft.net \
    --cc=fengyuleidian0615@gmail.com \
    --cc=johnwheffner@gmail.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).