summaryrefslogtreecommitdiffstats
path: root/drivers/net/geneve.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2018-10-12 23:53:58 +0200
committerDavid S. Miller <davem@davemloft.net>2018-10-17 21:51:13 -0700
commit7463e4f9b99c089cc962033b46349ff29f466e40 (patch)
tree6fbeefca60c20be0d9a94de89e1c14294f7a2f9d /drivers/net/geneve.c
parent0ac1077e3a549bf8d35971613e2be05bdbb41a00 (diff)
downloadlinux-7463e4f9b99c089cc962033b46349ff29f466e40.tar.bz2
geneve, vxlan: Don't check skb_dst() twice
Commit f15ca723c1eb ("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: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r--drivers/net/geneve.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 6acb6b5718b9..61c4bfbeb41c 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -830,12 +830,8 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
if (IS_ERR(rt))
return PTR_ERR(rt);
- if (skb_dst(skb)) {
- int mtu = dst_mtu(&rt->dst) - GENEVE_IPV4_HLEN -
- info->options_len;
-
- skb_dst_update_pmtu(skb, mtu);
- }
+ skb_dst_update_pmtu(skb, dst_mtu(&rt->dst) -
+ GENEVE_IPV4_HLEN - info->options_len);
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
if (geneve->collect_md) {
@@ -876,11 +872,8 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
if (IS_ERR(dst))
return PTR_ERR(dst);
- if (skb_dst(skb)) {
- int mtu = dst_mtu(dst) - GENEVE_IPV6_HLEN - info->options_len;
-
- skb_dst_update_pmtu(skb, mtu);
- }
+ skb_dst_update_pmtu(skb, dst_mtu(dst) -
+ GENEVE_IPV6_HLEN - info->options_len);
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
if (geneve->collect_md) {