]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vxlan: Accept user specified MTU value when create new vxlan link
authorChen Haiquan <oc@yunify.com>
Fri, 27 May 2016 02:49:11 +0000 (10:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 May 2016 18:46:00 +0000 (11:46 -0700)
When create a new vxlan link, example:
  ip link add vtap mtu 1440 type vxlan vni 1 dev eth0

The argument "mtu" has no effect, because it is not set to conf->mtu. The
default value is used in vxlan_dev_configure function.

This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device
configuration).

Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration)
Signed-off-by: Chen Haiquan <oc@yunify.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index 8ff30c3bdfceab5e5aca07bfaeb8635bec96ae0e..f999db2f97b4bb1b9254affc58f187b35da1c3f1 100644 (file)
@@ -3086,6 +3086,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
        if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
                conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL;
 
+       if (tb[IFLA_MTU])
+               conf.mtu = nla_get_u32(tb[IFLA_MTU]);
+
        err = vxlan_dev_configure(src_net, dev, &conf);
        switch (err) {
        case -ENODEV: