Subject: [PATCH] nethost: Minor cleanups. From: Eric W. Biederman Date: 1137525655 -0700 Don't call dev_close from do_put_host as it is called elsewhere if needed. Improve the comments. Drop and reaquire the rtnl_lock more often (I don't know if this is good or bad). --- net/core/host.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) fefb36ad156ae075227611a5b6c9dc724e3e0c4d diff --git a/net/core/host.c b/net/core/host.c index 2fc77e6..df5c821 100644 --- a/net/core/host.c +++ b/net/core/host.c @@ -28,12 +28,11 @@ static void do_put_host(void *arg) int err, i; if (dev->host != host) continue; + + /* Ignore the loopback interface */ if (dev == lo) continue; -#if 1 - /* Bring down the network device */ - dev_close(dev); -#endif + /* Push remaining network devices to init_host */ err = dev_change_nethost(dev, &init_host); #if 1 @@ -52,8 +51,10 @@ static void do_put_host(void *arg) unregister_netdevice(dev); } } - + rtnl_unlock(); + /* Unregister my hosts loopback device */ + rtnl_lock(); unregister_netdevice(lo); rtnl_unlock(); -- 1.0.GIT