aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index f1647d7dd14b..853c8b575f1d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -883,6 +883,9 @@ int dev_change_name(struct net_device *dev, char *newname)
883 if (!dev_valid_name(newname)) 883 if (!dev_valid_name(newname))
884 return -EINVAL; 884 return -EINVAL;
885 885
886 if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
887 return 0;
888
886 memcpy(oldname, dev->name, IFNAMSIZ); 889 memcpy(oldname, dev->name, IFNAMSIZ);
887 890
888 if (strchr(newname, '%')) { 891 if (strchr(newname, '%')) {
@@ -2665,7 +2668,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
2665 proc_net_remove(net, "dev"); 2668 proc_net_remove(net, "dev");
2666} 2669}
2667 2670
2668static struct pernet_operations __net_initdata dev_proc_ops = { 2671static struct pernet_operations dev_proc_ops = {
2669 .init = dev_proc_net_init, 2672 .init = dev_proc_net_init,
2670 .exit = dev_proc_net_exit, 2673 .exit = dev_proc_net_exit,
2671}; 2674};
@@ -4325,7 +4328,7 @@ static void __net_exit netdev_exit(struct net *net)
4325 kfree(net->dev_index_head); 4328 kfree(net->dev_index_head);
4326} 4329}
4327 4330
4328static struct pernet_operations __net_initdata netdev_net_ops = { 4331static struct pernet_operations netdev_net_ops = {
4329 .init = netdev_init, 4332 .init = netdev_init,
4330 .exit = netdev_exit, 4333 .exit = netdev_exit,
4331}; 4334};
@@ -4356,7 +4359,7 @@ static void __net_exit default_device_exit(struct net *net)
4356 rtnl_unlock(); 4359 rtnl_unlock();
4357} 4360}
4358 4361
4359static struct pernet_operations __net_initdata default_device_ops = { 4362static struct pernet_operations default_device_ops = {
4360 .exit = default_device_exit, 4363 .exit = default_device_exit,
4361}; 4364};
4362 4365