Commit 7463e4f9 authored by Stefano Brivio's avatar Stefano Brivio Committed by David S. Miller

geneve, vxlan: Don't check skb_dst() twice

Commit f15ca723 ("net: don't call update_pmtu unconditionally") avoids
that we try updating PMTU for a non-existent destination, but didn't clean
up cases where the check was already explicit. Drop those redundant checks.
Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ac1077e
...@@ -830,12 +830,8 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev, ...@@ -830,12 +830,8 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
if (IS_ERR(rt)) if (IS_ERR(rt))
return PTR_ERR(rt); return PTR_ERR(rt);
if (skb_dst(skb)) { skb_dst_update_pmtu(skb, dst_mtu(&rt->dst) -
int mtu = dst_mtu(&rt->dst) - GENEVE_IPV4_HLEN - GENEVE_IPV4_HLEN - info->options_len);
info->options_len;
skb_dst_update_pmtu(skb, mtu);
}
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
if (geneve->collect_md) { if (geneve->collect_md) {
...@@ -876,11 +872,8 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev, ...@@ -876,11 +872,8 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
if (IS_ERR(dst)) if (IS_ERR(dst))
return PTR_ERR(dst); return PTR_ERR(dst);
if (skb_dst(skb)) { skb_dst_update_pmtu(skb, dst_mtu(dst) -
int mtu = dst_mtu(dst) - GENEVE_IPV6_HLEN - info->options_len; GENEVE_IPV6_HLEN - info->options_len);
skb_dst_update_pmtu(skb, mtu);
}
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
if (geneve->collect_md) { if (geneve->collect_md) {
......
...@@ -2194,11 +2194,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, ...@@ -2194,11 +2194,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
} }
ndst = &rt->dst; ndst = &rt->dst;
if (skb_dst(skb)) { skb_dst_update_pmtu(skb, dst_mtu(ndst) - VXLAN_HEADROOM);
int mtu = dst_mtu(ndst) - VXLAN_HEADROOM;
skb_dst_update_pmtu(skb, mtu);
}
tos = ip_tunnel_ecn_encap(tos, old_iph, skb); tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
...@@ -2235,11 +2231,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, ...@@ -2235,11 +2231,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
goto out_unlock; goto out_unlock;
} }
if (skb_dst(skb)) { skb_dst_update_pmtu(skb, dst_mtu(ndst) - VXLAN6_HEADROOM);
int mtu = dst_mtu(ndst) - VXLAN6_HEADROOM;
skb_dst_update_pmtu(skb, mtu);
}
tos = ip_tunnel_ecn_encap(tos, old_iph, skb); tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
ttl = ttl ? : ip6_dst_hoplimit(ndst); ttl = ttl ? : ip6_dst_hoplimit(ndst);
......
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