]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ip_tunnel: Resolve ipsec merge conflict properly.
authorDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 15:42:14 +0000 (11:42 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 15:42:14 +0000 (11:42 -0400)
We want to use dev_set_mtu() regardless of how we calculate
the mtu value.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel.c

index f3db1f35a79dd3b6fab195e650baee9fedd4e5ec..a7fd1c5a2a14935ef0b40f781b248f90de294cf0 100644 (file)
@@ -1120,14 +1120,14 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
        if (tb[IFLA_MTU]) {
                unsigned int max = 0xfff8 - dev->hard_header_len - nt->hlen;
 
-               dev->mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
-                                (unsigned int)(max - sizeof(struct iphdr)));
-       } else {
-               err = dev_set_mtu(dev, mtu);
-               if (err)
-                       goto err_dev_set_mtu;
+               mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
+                           (unsigned int)(max - sizeof(struct iphdr)));
        }
 
+       err = dev_set_mtu(dev, mtu);
+       if (err)
+               goto err_dev_set_mtu;
+
        ip_tunnel_add(itn, nt);
        return 0;