Commit fb9e3ee2 authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by David S. Miller

Fix for ipv4 tunnel devices:

- do not make path mtu discovery, when it is disabled :-)
parent 8cf9e590
...@@ -760,7 +760,10 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -760,7 +760,10 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
} }
df = tiph->frag_off; df = tiph->frag_off;
if (df)
mtu = rt->u.dst.pmtu - tunnel->hlen; mtu = rt->u.dst.pmtu - tunnel->hlen;
else
mtu = skb->dst ? skb->dst->pmtu : dev->mtu;
if (skb->protocol == __constant_htons(ETH_P_IP)) { if (skb->protocol == __constant_htons(ETH_P_IP)) {
if (skb->dst && mtu < skb->dst->pmtu && mtu >= 68) if (skb->dst && mtu < skb->dst->pmtu && mtu >= 68)
......
...@@ -572,7 +572,11 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -572,7 +572,11 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
goto tx_error; goto tx_error;
} }
if (tiph->frag_off)
mtu = rt->u.dst.pmtu - sizeof(struct iphdr); mtu = rt->u.dst.pmtu - sizeof(struct iphdr);
else
mtu = skb->dst ? skb->dst->pmtu : dev->mtu;
if (mtu < 68) { if (mtu < 68) {
tunnel->stat.collisions++; tunnel->stat.collisions++;
ip_rt_put(rt); ip_rt_put(rt);
......
...@@ -517,7 +517,11 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -517,7 +517,11 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
goto tx_error; goto tx_error;
} }
if (tiph->frag_off)
mtu = rt->u.dst.pmtu - sizeof(struct iphdr); mtu = rt->u.dst.pmtu - sizeof(struct iphdr);
else
mtu = skb->dst ? skb->dst->pmtu : dev->mtu;
if (mtu < 68) { if (mtu < 68) {
tunnel->stat.collisions++; tunnel->stat.collisions++;
ip_rt_put(rt); ip_rt_put(rt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment