All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hagen Paul Pfeifer <hagen@jauu.net>
To: netdev@vger.kernel.org
Cc: Hagen Paul Pfeifer <hagen@jauu.net>,
	Fernando Gont <fgont@si6networks.com>
Subject: [RFC PATCH net-next] ipv6: stop sending PTB packets for MTU < 1280
Date: Tue, 26 Aug 2014 00:25:45 +0200	[thread overview]
Message-ID: <1409005545-24910-2-git-send-email-hagen@jauu.net> (raw)
In-Reply-To: <53F39E50.1020209@gont.com.ar>

Reduce the attack vector and stop generating ICMPv6 packet to big for
packets smaller then the minimal required IPv6 MTU.

See
http://tools.ietf.org/html/draft-gont-6man-deprecate-atomfrag-generation-00

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
 net/ipv6/route.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f74b041..84ebacd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1154,12 +1154,9 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
 		struct net *net = dev_net(dst->dev);
 
 		rt6->rt6i_flags |= RTF_MODIFIED;
-		if (mtu < IPV6_MIN_MTU) {
-			u32 features = dst_metric(dst, RTAX_FEATURES);
+		if (mtu < IPV6_MIN_MTU)
 			mtu = IPV6_MIN_MTU;
-			features |= RTAX_FEATURE_ALLFRAG;
-			dst_metric_set(dst, RTAX_FEATURES, features);
-		}
+
 		dst_metric_set(dst, RTAX_MTU, mtu);
 		rt6_update_expires(rt6, net->ipv6.sysctl.ip6_rt_mtu_expires);
 	}
-- 
2.1.0

  reply	other threads:[~2014-08-25 22:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53F33C4F.2070807@si6networks.com>
2014-08-19 18:58 ` Deprecating the *generation* of IPv6 atomic fragments (Fwd: DoS attacks (ICMPv6-based) resulting from IPv6 EH drops) Fernando Gont
2014-08-25 22:25   ` Hagen Paul Pfeifer [this message]
2014-08-25 22:47     ` [RFC PATCH net-next] ipv6: stop sending PTB packets for MTU < 1280 Hannes Frederic Sowa
2014-08-26  8:06       ` Hagen Paul Pfeifer
2014-08-27 20:33       ` Fernando Gont
2014-08-27 20:57         ` Hagen Paul Pfeifer
2014-08-27 23:07         ` Hannes Frederic Sowa

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=1409005545-24910-2-git-send-email-hagen@jauu.net \
    --to=hagen@jauu.net \
    --cc=fgont@si6networks.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.