Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30877961 authored by Xin Long's avatar Xin Long Committed by David S. Miller
Browse files

ipvlan: fix IFLA_MTU ignored on NEWLINK



Commit 296d4856 ("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: 296d4856 ("ipvlan: inherit MTU from master device")
Reported-by: default avatarJianlin Shi <jishi@redhat.com>
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fedb1bd3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -594,6 +594,7 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev,
	ipvlan->phy_dev = phy_dev;
	ipvlan->dev = dev;
	ipvlan->sfeatures = IPVLAN_FEATURES;
	if (!tb[IFLA_MTU])
		ipvlan_adjust_mtu(ipvlan, phy_dev);
	INIT_LIST_HEAD(&ipvlan->addrs);
	spin_lock_init(&ipvlan->addrs_lock);