Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chen Haiquan and committed by
David S. Miller
ce577668 bcf91bdb

+3
+3
drivers/net/vxlan.c
··· 3086 3086 if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL]) 3087 3087 conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL; 3088 3088 3089 + if (tb[IFLA_MTU]) 3090 + conf.mtu = nla_get_u32(tb[IFLA_MTU]); 3091 + 3089 3092 err = vxlan_dev_configure(src_net, dev, &conf); 3090 3093 switch (err) { 3091 3094 case -ENODEV: