hlist_for_each_entry_rcu(dev, head, name_hlist)
if (!strncmp(dev->name, name, IFNAMSIZ)) return dev;
return NULL;
}
static int dev_get_valid_name(struct net *net, struct net_device *dev, const char *name)
{ BUG_ON(!net);
if (!dev_valid_name(name)) return -EINVAL;
if (strchr(name, '%')) return dev_alloc_name_ns(net, dev, name);
else if (__dev_get_by_name(net, name)) return -EEXIST;
else if (dev->name != name) strlcpy(dev->name, name, IFNAMSIZ);
return 0;
}
So this seems to be where the IOCTL error originates, but there needs to be an explanation.
Looking at the 'git damage' and commit history for 'net/core/dev.c' in particular there are some control-group related changes that look like they may be implicated. They certainly seem to be in the appropriate time-frame since earlier kernels don't have the problem (I have another server with 12.04 LTS and Linux 3.2.0 which has 10 Ethernet ports which are renamed correctly).
Following "ioctl(sk, SIOCSIFNAME, &ifr)" through the kernel:
net/core/ dev_ioctl: :dev_ioctl( ) dev_ioctl. c::dev_ ifsioc( ) dev.c:: dev_change_ name() core/dev. c::dev_ get_valid_ name() core/dev. c::__dev_ get_by_ name()
net/core/
net/core/
net/
net/
struct net_device *dev_get_ by_name_ rcu(struct net *net, const char *name)
{
struct net_device *dev;
struct hlist_head *head = dev_name_hash(net, name);
if (!strncmp(
return NULL;
}
static int dev_get_ valid_name( struct net *net,
struct net_device *dev,
const char *name)
BUG_ON( !net);
{
if (!dev_valid_ name(name) )
return -EINVAL;
if (strchr(name, '%'))
return dev_alloc_ name_ns( net, dev, name); get_by_ name(net, name))
return -EEXIST;
strlcpy( dev->name, name, IFNAMSIZ);
else if (__dev_
else if (dev->name != name)
return 0;
}
So this seems to be where the IOCTL error originates, but there needs to be an explanation.
Looking at the 'git damage' and commit history for 'net/core/dev.c' in particular there are some control-group related changes that look like they may be implicated. They certainly seem to be in the appropriate time-frame since earlier kernels don't have the problem (I have another server with 12.04 LTS and Linux 3.2.0 which has 10 Ethernet ports which are renamed correctly).