aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index bf4af5248cb7..ca142c47b2e4 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -37,6 +37,7 @@
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/init.h> 38#include <linux/init.h>
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/slab.h>
40#include <linux/console.h> 41#include <linux/console.h>
41#include <linux/moduleparam.h> 42#include <linux/moduleparam.h>
42#include <linux/string.h> 43#include <linux/string.h>
@@ -664,7 +665,8 @@ static int netconsole_netdev_event(struct notifier_block *this,
664 struct netconsole_target *nt; 665 struct netconsole_target *nt;
665 struct net_device *dev = ptr; 666 struct net_device *dev = ptr;
666 667
667 if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER)) 668 if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
669 event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN))
668 goto done; 670 goto done;
669 671
670 spin_lock_irqsave(&target_list_lock, flags); 672 spin_lock_irqsave(&target_list_lock, flags);
@@ -676,19 +678,21 @@ static int netconsole_netdev_event(struct notifier_block *this,
676 strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); 678 strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
677 break; 679 break;
678 case NETDEV_UNREGISTER: 680 case NETDEV_UNREGISTER:
679 if (!nt->enabled)
680 break;
681 netpoll_cleanup(&nt->np); 681 netpoll_cleanup(&nt->np);
682 /* Fall through */
683 case NETDEV_GOING_DOWN:
684 case NETDEV_BONDING_DESLAVE:
682 nt->enabled = 0; 685 nt->enabled = 0;
683 printk(KERN_INFO "netconsole: network logging stopped"
684 ", interface %s unregistered\n",
685 dev->name);
686 break; 686 break;
687 } 687 }
688 } 688 }
689 netconsole_target_put(nt); 689 netconsole_target_put(nt);
690 } 690 }
691 spin_unlock_irqrestore(&target_list_lock, flags); 691 spin_unlock_irqrestore(&target_list_lock, flags);
692 if (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE)
693 printk(KERN_INFO "netconsole: network logging stopped, "
694 "interface %s %s\n", dev->name,
695 event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
692 696
693done: 697done:
694 return NOTIFY_DONE; 698 return NOTIFY_DONE;