@@ -1142,7 +1142,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
}
snprintf(buf, IFNAMSIZ, name, i);
- if (!__dev_get_by_name(net, buf))
+ if (!netdev_name_node_lookup(net, buf))
return i;
/* It is possible to run out of possible slots
@@ -1196,7 +1196,7 @@ static int dev_get_valid_name(struct net *net, struct net_device *dev,
if (strchr(name, '%'))
return dev_alloc_name_ns(net, dev, name);
- else if (__dev_get_by_name(net, name))
+ else if (netdev_name_node_lookup(net, name))
return -EEXIST;
else if (dev->name != name)
strlcpy(dev->name, name, IFNAMSIZ);
@@ -11164,7 +11164,7 @@ int __dev_change_net_namespace(struct net_device *dev, struct net *net,
* we can use it in the destination network namespace.
*/
err = -EEXIST;
- if (__dev_get_by_name(net, dev->name)) {
+ if (netdev_name_node_lookup(net, dev->name)) {
/* We get here if we can't use the current device name */
if (!pat)
goto out;
@@ -11518,7 +11518,7 @@ static void __net_exit default_device_exit(struct net *net)
/* Push remaining network devices to init_net */
snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
- if (__dev_get_by_name(&init_net, fb_name))
+ if (netdev_name_node_lookup(&init_net, fb_name))
snprintf(fb_name, IFNAMSIZ, "dev%%d");
err = dev_change_net_namespace(dev, &init_net, fb_name);
if (err) {
netdev_name_node_lookup and __dev_get_by_name have two distinct aims, one helps in name collision detection, while the other is used to retrieve a reference to a net device from its name. Fix the callers checking for a name collision. (The behaviour of the two functions was similar but will change in the next commits). Signed-off-by: Antoine Tenart <atenart@kernel.org> --- net/core/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)