From: Konstantin Shemyak <konstantin@shemyak.com>
To: David Miller <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
pshelar@nicira.com
Subject: [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL
Date: Sat, 5 Dec 2015 22:55:13 +0200 [thread overview]
Message-ID: <56634F31.3000609@shemyak.com> (raw)
The DF bit on IPv4 GRE tunnels with fixed TTL is enforced in order
to prevent networking loops. This was the original behavior of GRE
tunnels, lost in the refactoring.
Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
---
net/ipv4/ip_gre.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 6145214..485bf27 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -679,6 +679,10 @@ static int ipgre_tunnel_ioctl(struct net_device *dev,
((p.i_flags|p.o_flags)&(GRE_VERSION|GRE_ROUTING)))
return -EINVAL;
}
+
+ if (p.iph.ttl)
+ p.iph.frag_off |= htons(IP_DF);
+
p.i_flags = gre_flags_to_tnl_flags(p.i_flags);
p.o_flags = gre_flags_to_tnl_flags(p.o_flags);
--
1.9.1
next reply other threads:[~2015-12-05 20:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 20:55 Konstantin Shemyak [this message]
2015-12-05 21:48 ` [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL Pravin Shelar
2015-12-07 3:37 ` 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=56634F31.3000609@shemyak.com \
--to=konstantin@shemyak.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
/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