提交 7af12cba 编写于 作者: J Jiri Pirko 提交者: David S. Miller

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: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 88f4fb0c
......@@ -3080,12 +3080,10 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
ifm = nlmsg_data(nlh);
if (ifm->ifi_index > 0)
dev = __dev_get_by_index(net, ifm->ifi_index);
else {
if (ifname[0])
dev = __dev_get_by_name(net, ifname);
else
dev = NULL;
}
else if (tb[IFLA_IFNAME])
dev = __dev_get_by_name(net, ifname);
else
dev = NULL;
if (dev) {
master_dev = netdev_master_upper_dev_get(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册