lkml.org 
[lkml]   [2009]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Allow renaming of network interfaces that are up.
From
Date
The ancient restriction banning renaming of busy network interfaces appears
to be purposeless. Everything that depends on a network interface's name is
done under the dev_base_lock in any case.

This makes it much easier to use things like netconsole which bring up a
network interface before userspace has started: presently these will cause
interface renamings to fail, breaking any userspace that relies on renaming
devices to avoid reliance on the potentially-unstable kernel-assigned name.

Signed-off-by: Nick Alcock <nix@esperi.org.uk>
---
net/core/dev.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

Note: this may very well be wrong, as I know essentially nothing about this
part of the kernel. All I know is that without a patch something like this,
netconsole is nearly useless to me, so many panics are uncapturable. Maybe
there is some constraint preventing the kernel from reliably renaming
up interfaces. In that case, netconsole, DHCP netboot discovery and so on
probably need to grow the ability to rename them themselves.

diff --git a/net/core/dev.c b/net/core/dev.c
index b8f74cf..87e9f88 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -901,8 +901,6 @@ int dev_change_name(struct net_device *dev, const char *newname)
BUG_ON(!dev_net(dev));

net = dev_net(dev);
- if (dev->flags & IFF_UP)
- return -EBUSY;

if (!dev_valid_name(newname))
return -EINVAL;
--
1.6.5.1

\
 
 \ /
  Last update: 2009-10-20 20:57    [W:0.112 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site