diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-09-30 12:48:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-02 00:47:19 +0300 |
commit | 7af12cba4ef0caf20bddf84f90509e71006d5408 (patch) | |
tree | b82e9700fbd64855c2557ee197aca54730eeb451 /net/core/rtnetlink.c | |
parent | 88f4fb0c7496a13b887bdc5052e3aabe3e4dcc5f (diff) | |
download | linux-7af12cba4ef0caf20bddf84f90509e71006d5408.tar.xz |
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>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 10 |
1 files 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 @@ replay: 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); |