Skip to content

Commit ec4ffd1

Browse files
NicolasDichtelkuba-moo
authored andcommitted
Revert "net: rtnetlink: Enslave device before bringing it up"
This reverts commit a4abfa6. The patch broke: > ip link set dummy0 up > ip link set dummy0 master bond0 down This last command is useful to be able to enslave an interface with only one netlink message. After discussion, there is no good reason to support: > ip link set dummy0 down > ip link set dummy0 master bond0 up because the bond interface already set the slave up when it is up. Cc: stable@vger.kernel.org Fixes: a4abfa6 ("net: rtnetlink: Enslave device before bringing it up") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://lore.kernel.org/r/20240108094103.2001224-2-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8722014 commit ec4ffd1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

net/core/rtnetlink.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2899,20 +2899,20 @@ static int do_setlink(const struct sk_buff *skb,
28992899
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
29002900
}
29012901

2902-
if (tb[IFLA_MASTER]) {
2903-
err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]), extack);
2904-
if (err)
2905-
goto errout;
2906-
status |= DO_SETLINK_MODIFIED;
2907-
}
2908-
29092902
if (ifm->ifi_flags || ifm->ifi_change) {
29102903
err = dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm),
29112904
extack);
29122905
if (err < 0)
29132906
goto errout;
29142907
}
29152908

2909+
if (tb[IFLA_MASTER]) {
2910+
err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]), extack);
2911+
if (err)
2912+
goto errout;
2913+
status |= DO_SETLINK_MODIFIED;
2914+
}
2915+
29162916
if (tb[IFLA_CARRIER]) {
29172917
err = dev_change_carrier(dev, nla_get_u8(tb[IFLA_CARRIER]));
29182918
if (err)

0 commit comments

Comments
 (0)