diff options
author | Chen Haiquan <oc@yunify.com> | 2016-05-27 10:49:11 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-31 11:46:00 -0700 |
commit | ce577668a426c6a9e2470a09dcd07fbd6e45272a (patch) | |
tree | 2d101630f20f730773a3dd3b9df70e721328030b /drivers/net/vxlan.c | |
parent | bcf91bdb44d2e6d84ffc5b7ab0400d5ff1c27645 (diff) | |
download | linux-ce577668a426c6a9e2470a09dcd07fbd6e45272a.tar.gz linux-ce577668a426c6a9e2470a09dcd07fbd6e45272a.tar.bz2 linux-ce577668a426c6a9e2470a09dcd07fbd6e45272a.zip |
vxlan: Accept user specified MTU value when create new vxlan link
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>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 8ff30c3bdfce..f999db2f97b4 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -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: |