ipvlan: fix IFLA_MTU ignored on NEWLINK
authorXin Long <lucien.xin@gmail.com>
Thu, 21 Jun 2018 04:56:04 +0000 (12:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 12:28:43 +0000 (14:28 +0200)
commitf5a42d63f0d417654a8a4d4448015e1c642ee338
tree4616efb8da495b007e77e38b2229b0ae711fc1e0
parentd10c0baaae3f84185db3b3076a87d4343c9d62e6
ipvlan: fix IFLA_MTU ignored on NEWLINK

[ Upstream commit 30877961b1cdd6fdca783c2e8c4f0f47e95dc58c ]

Commit 296d48568042 ("ipvlan: inherit MTU from master device") adjusted
the mtu from the master device when creating a ipvlan device, but it
would also override the mtu value set in rtnl_create_link. It causes
IFLA_MTU param not to take effect.

So this patch is to not adjust the mtu if IFLA_MTU param is set when
creating a ipvlan device.

Fixes: 296d48568042 ("ipvlan: inherit MTU from master device")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ipvlan/ipvlan_main.c