* [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df
[not found] <20150707033906.GF1173@brightrain.aerifal.cx>
@ 2015-07-07 5:34 ` Timo Teräs
2015-07-07 22:07 ` Pravin Shelar
2015-07-08 23:03 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Timo Teräs @ 2015-07-07 5:34 UTC (permalink / raw)
To: netdev; +Cc: Timo Teräs, Pravin B Shelar
Frag needed should be sent only if the inner header asked
to not fragment. Currently fragmentation is broken if the
tunnel has df set, but df was not asked in the original
packet. The tunnel's df needs to be still checked to update
internally the pmtu cache.
Commit 23a3647bc4f93bac broke it, and this commit fixes
the ipv4 df check back to the way it was.
Fixes: 23a3647bc4f93bac ("ip_tunnels: Use skb-len to PMTU check.")
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
Should go to -stable queues (3.12.y and newer).
v2: revised commit message wording a bit, and added
signed-off-by line that was forgotten accidentally.
net/ipv4/ip_tunnel.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 4c2c3ba..626d9e5 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -586,7 +586,8 @@ int ip_tunnel_encap(struct sk_buff *skb, struct ip_tunnel *t,
EXPORT_SYMBOL(ip_tunnel_encap);
static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
- struct rtable *rt, __be16 df)
+ struct rtable *rt, __be16 df,
+ const struct iphdr *inner_iph)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
@@ -603,7 +604,8 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
if (skb->protocol == htons(ETH_P_IP)) {
if (!skb_is_gso(skb) &&
- (df & htons(IP_DF)) && mtu < pkt_size) {
+ (inner_iph->frag_off & htons(IP_DF)) &&
+ mtu < pkt_size) {
memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
return -E2BIG;
@@ -737,7 +739,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
goto tx_error;
}
- if (tnl_update_pmtu(dev, skb, rt, tnl_params->frag_off)) {
+ if (tnl_update_pmtu(dev, skb, rt, tnl_params->frag_off, inner_iph)) {
ip_rt_put(rt);
goto tx_error;
}
--
2.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df
2015-07-07 5:34 ` [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df Timo Teräs
@ 2015-07-07 22:07 ` Pravin Shelar
2015-07-08 23:03 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Pravin Shelar @ 2015-07-07 22:07 UTC (permalink / raw)
To: Timo Teräs; +Cc: netdev
On Mon, Jul 6, 2015 at 10:34 PM, Timo Teräs <timo.teras@iki.fi> wrote:
> Frag needed should be sent only if the inner header asked
> to not fragment. Currently fragmentation is broken if the
> tunnel has df set, but df was not asked in the original
> packet. The tunnel's df needs to be still checked to update
> internally the pmtu cache.
>
> Commit 23a3647bc4f93bac broke it, and this commit fixes
> the ipv4 df check back to the way it was.
>
> Fixes: 23a3647bc4f93bac ("ip_tunnels: Use skb-len to PMTU check.")
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Timo Teräs <timo.teras@iki.fi>
> ---
> Should go to -stable queues (3.12.y and newer).
>
> v2: revised commit message wording a bit, and added
> signed-off-by line that was forgotten accidentally.
>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df
2015-07-07 5:34 ` [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df Timo Teräs
2015-07-07 22:07 ` Pravin Shelar
@ 2015-07-08 23:03 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-07-08 23:03 UTC (permalink / raw)
To: timo.teras; +Cc: netdev, pshelar
From: Timo Teräs <timo.teras@iki.fi>
Date: Tue, 7 Jul 2015 08:34:13 +0300
> Frag needed should be sent only if the inner header asked
> to not fragment. Currently fragmentation is broken if the
> tunnel has df set, but df was not asked in the original
> packet. The tunnel's df needs to be still checked to update
> internally the pmtu cache.
>
> Commit 23a3647bc4f93bac broke it, and this commit fixes
> the ipv4 df check back to the way it was.
>
> Fixes: 23a3647bc4f93bac ("ip_tunnels: Use skb-len to PMTU check.")
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-08 23:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20150707033906.GF1173@brightrain.aerifal.cx>
2015-07-07 5:34 ` [PATCH net,v2] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df Timo Teräs
2015-07-07 22:07 ` Pravin Shelar
2015-07-08 23:03 ` David Miller
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).