From f1cb7c9b1782a65017362218912f9979c4f00c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= Date: Wed, 29 Apr 2009 20:45:17 +0000 Subject: [PATCH] --- yaml --- r: 144587 b: refs/heads/master c: 2382b15bcc39228572ccf1d9a1185dcabb84c833 h: refs/heads/master i: 144585: e35ccdc6e422680a44ec100d5523327a4f394fd6 144583: c6e6ef9bc217c9dbcaa92a0a16b656d75a30aac6 v: v3 --- [refs] | 2 +- trunk/drivers/net/netconsole.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1dc100874e0c..f1f8b435365d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: acda074390270ca9e28f2a9729f7b835e2ad6da4 +refs/heads/master: 2382b15bcc39228572ccf1d9a1185dcabb84c833 diff --git a/trunk/drivers/net/netconsole.c b/trunk/drivers/net/netconsole.c index eceadf787a67..bf4af5248cb7 100644 --- a/trunk/drivers/net/netconsole.c +++ b/trunk/drivers/net/netconsole.c @@ -664,7 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this, struct netconsole_target *nt; struct net_device *dev = ptr; - if (!(event == NETDEV_CHANGENAME)) + if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER)) goto done; spin_lock_irqsave(&target_list_lock, flags); @@ -675,6 +675,15 @@ static int netconsole_netdev_event(struct notifier_block *this, case NETDEV_CHANGENAME: strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); break; + case NETDEV_UNREGISTER: + if (!nt->enabled) + break; + netpoll_cleanup(&nt->np); + nt->enabled = 0; + printk(KERN_INFO "netconsole: network logging stopped" + ", interface %s unregistered\n", + dev->name); + break; } } netconsole_target_put(nt);