* [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
* Re: [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL
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
1 sibling, 0 replies; 3+ messages in thread
From: Pravin Shelar @ 2015-12-05 21:48 UTC (permalink / raw)
To: Konstantin Shemyak
Cc: David Miller, netdev@vger.kernel.org, Hannes Frederic Sowa
On Sat, Dec 5, 2015 at 12:55 PM, Konstantin Shemyak
<konstantin@shemyak.com> wrote:
> 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);
> +
Same code already exist in ip_tunnel_ioctl() which is common function
for IP based tunnel modules. Why does that not work?
> 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 [flat|nested] 3+ messages in thread
* Re: [PATCH] Set DF bit for IPv4 GRE tunnels with fixed TTL
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
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-12-07 3:37 UTC (permalink / raw)
To: konstantin; +Cc: netdev, hannes, pshelar
From: Konstantin Shemyak <konstantin@shemyak.com>
Date: Sat, 5 Dec 2015 22:55:13 +0200
> 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>
Like Pravin said, ip_tunnel_ioctl() does this already, the code
you are adding is superfluous.
^ permalink raw reply [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