net: rtnetlink: unify the code in __rtnl_newlink get dev with the rest
__rtnl_newlink() code flow is a bit different around tb[IFLA_IFNAME] processing comparing to the other places. Change that to be unified with the rest. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
88f4fb0c74
commit
7af12cba4e
@@ -3080,12 +3080,10 @@ replay:
|
|||||||
ifm = nlmsg_data(nlh);
|
ifm = nlmsg_data(nlh);
|
||||||
if (ifm->ifi_index > 0)
|
if (ifm->ifi_index > 0)
|
||||||
dev = __dev_get_by_index(net, ifm->ifi_index);
|
dev = __dev_get_by_index(net, ifm->ifi_index);
|
||||||
else {
|
else if (tb[IFLA_IFNAME])
|
||||||
if (ifname[0])
|
dev = __dev_get_by_name(net, ifname);
|
||||||
dev = __dev_get_by_name(net, ifname);
|
else
|
||||||
else
|
dev = NULL;
|
||||||
dev = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
master_dev = netdev_master_upper_dev_get(dev);
|
master_dev = netdev_master_upper_dev_get(dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user