netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org, Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH 2/3] ipv4: Fix packet size calculation for IPsec packets in __ip_append_data
Date: Mon, 6 Jun 2011 08:48:02 +0200	[thread overview]
Message-ID: <20110606064802.GC31505@secunet.com> (raw)
In-Reply-To: <20110606064603.GB31505@secunet.com>

Git commit 59104f06 (ip: take care of last fragment in ip_append_data)
added a check to see if we exceed the mtu when we add trailer_len.
However, the mtu is already subtracted by trailer_len when the
xfrm transfomation bundles are set up. So IPsec packets with mtu
size get fragmented, or if the DF bit is set the packets will not
be send even though they match the mtu perfectly fine. This patch
actually reverts commit 59104f06.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/ip_output.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 98af369..a16859b 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -888,12 +888,9 @@ alloc_new_skb:
 			 * because we have no idea what fragment will be
 			 * the last.
 			 */
-			if (datalen == length + fraggap) {
+			if (datalen == length + fraggap)
 				alloclen += rt->dst.trailer_len;
-				/* make sure mtu is not reached */
-				if (datalen > mtu - fragheaderlen - rt->dst.trailer_len)
-					datalen -= ALIGN(rt->dst.trailer_len, 8);
-			}
+
 			if (transhdrlen) {
 				skb = sock_alloc_send_skb(sk,
 						alloclen + hh_len + 15,
-- 
1.7.0.4


  reply	other threads:[~2011-06-06  6:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06  6:46 [PATCH 1/3] xfrm: Fix off by one in the replay advance functions Steffen Klassert
2011-06-06  6:48 ` Steffen Klassert [this message]
2011-06-06  7:38   ` [PATCH 2/3] ipv4: Fix packet size calculation for IPsec packets in __ip_append_data Eric Dumazet
2011-06-06  8:52     ` Steffen Klassert
2011-06-07  5:06       ` Eric Dumazet
2011-06-08  5:30         ` Steffen Klassert
2011-06-09 21:47           ` David Miller
2011-06-22 11:02             ` Steffen Klassert
2011-06-28  3:39               ` David Miller
2011-06-30  9:06                 ` Steffen Klassert
2011-06-06  6:48 ` [PATCH 3/3] ipv4: Fix packet size calculation for raw " Steffen Klassert
2011-06-09 21:50   ` David Miller
2011-06-08  4:15 ` [PATCH 1/3] xfrm: Fix off by one in the replay advance functions 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=20110606064802.GC31505@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --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).