[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190719110029.29466-6-jiri@resnulli.us>
Date: Fri, 19 Jul 2019 13:00:27 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, jakub.kicinski@...ronome.com,
sthemmin@...rosoft.com, dsahern@...il.com, dcbw@...hat.com,
mkubecek@...e.cz, andrew@...n.ch, parav@...lanox.com,
saeedm@...lanox.com, mlxsw@...lanox.com
Subject: [patch net-next rfc 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 f11a2367037d..8994dc858ae0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3067,12 +3067,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