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

Configure Feed

Select the types of activity you want to include in your feed.

ipvlan: fix IFLA_MTU ignored on NEWLINK

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>

authored by

Xin Long and committed by
David S. Miller
30877961 fedb1bd3

+2 -1
+2 -1
drivers/net/ipvlan/ipvlan_main.c
··· 594 594 ipvlan->phy_dev = phy_dev; 595 595 ipvlan->dev = dev; 596 596 ipvlan->sfeatures = IPVLAN_FEATURES; 597 - ipvlan_adjust_mtu(ipvlan, phy_dev); 597 + if (!tb[IFLA_MTU]) 598 + ipvlan_adjust_mtu(ipvlan, phy_dev); 598 599 INIT_LIST_HEAD(&ipvlan->addrs); 599 600 spin_lock_init(&ipvlan->addrs_lock); 600 601