aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2020-08-24 23:20:28 -0400
committerDavid S. Miller <davem@davemloft.net>2020-08-25 06:04:39 -0700
commit8b4510d76cde3c6934d4caed2fe897bd831cdb82 (patch)
treeb3bad7bfc441bdeeeef2f669e36e82330e315e70 /net/ipv4
parentMerge tag 'batadv-next-for-davem-20200824' of git://git.open-mesh.org/linux-merge (diff)
downloadlinux-dev-8b4510d76cde3c6934d4caed2fe897bd831cdb82.tar.xz
linux-dev-8b4510d76cde3c6934d4caed2fe897bd831cdb82.zip
net: gain ipv4 mtu when mtu is not locked
When mtu is locked, we should not obtain ipv4 mtu as we return immediately in this case and leave acquired ipv4 mtu unused. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 8ca6bcab7b03..18c8baf32de5 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1013,13 +1013,14 @@ out: kfree_skb(skb);
static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
{
struct dst_entry *dst = &rt->dst;
- u32 old_mtu = ipv4_mtu(dst);
struct fib_result res;
bool lock = false;
+ u32 old_mtu;
if (ip_mtu_locked(dst))
return;
+ old_mtu = ipv4_mtu(dst);
if (old_mtu < mtu)
return;