Netdev List
 help / color / mirror / Atom feed
* [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL
@ 2015-12-05 20:55 Konstantin Shemyak
  2015-12-05 21:48 ` Pravin Shelar
  2015-12-07  3:37 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Konstantin Shemyak @ 2015-12-05 20:55 UTC (permalink / raw)
  To: David Miller, netdev@vger.kernel.org, Hannes Frederic Sowa,
	pshelar

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-07  3:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-05 20:55 [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL Konstantin Shemyak
2015-12-05 21:48 ` Pravin Shelar
2015-12-07  3:37 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox