[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190930094820.11281-6-jiri@resnulli.us>
Date: Mon, 30 Sep 2019 11:48:18 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, jakub.kicinski@...ronome.com,
dsahern@...il.com, roopa@...ulusnetworks.com, dcbw@...hat.com,
nikolay@...ulusnetworks.com, mkubecek@...e.cz, andrew@...n.ch,
parav@...lanox.com, saeedm@...lanox.com, f.fainelli@...il.com,
stephen@...workplumber.org, sd@...asysnail.net, sbrivio@...hat.com,
pabeni@...hat.com, mlxsw@...lanox.com
Subject: [patch net-next 5/7] net: rtnetlink: unify the code in __rtnl_newlink get dev with the rest
From: Jiri Pirko <jiri@...lanox.com>
__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@...lanox.com>
---
net/core/rtnetlink.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index c38917371b84..a0017737442f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -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);
--
2.21.0
Powered by blists - more mailing lists