netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atm: clip causes unregister hang
@ 2006-04-12 17:55 Stephen Hemminger
  2006-04-12 18:08 ` Herbert Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Stephen Hemminger @ 2006-04-12 17:55 UTC (permalink / raw)
  To: David S. Miller, chas; +Cc: linux-atm-general, netdev, stable

If Classical IP over ATM module is loaded or compile in to the kernel.
Its neighbor table gets populated when permanent neighbor entries are created;
but these entries are not flushed when the device is removed. 
Since the entry never gets flushed the unregister of the network device never
completes.

The problem is that the driver doesn't register a notify handler unless
ATM is started, and it doesn't do the proper cleanup in the event handler.

Please apply for 2.6.17 and 2.6.16 stable.

Bug-reference: http://bugzilla.kernel.org/show_bug.cgi?id=6295
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- linux-2.6.16.2.orig/net/atm/clip.c	2006-04-12 10:10:43.000000000 -0700
+++ linux-2.6.16.2/net/atm/clip.c	2006-04-12 10:15:46.000000000 -0700
@@ -613,12 +613,19 @@
 
 
 static int clip_device_event(struct notifier_block *this,unsigned long event,
-    void *dev)
+			     void *arg)
 {
+	struct net_device *dev = arg;
+
+	if (event == NETDEV_DOWN) {
+		neigh_ifdown(&clip_tbl, dev);
+		return NOTIFY_DONE;
+	}
+
 	/* ignore non-CLIP devices */
-	if (((struct net_device *) dev)->type != ARPHRD_ATM ||
-	    ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
+	if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
 		return NOTIFY_DONE;
+
 	switch (event) {
 		case NETDEV_UP:
 			DPRINTK("clip_device_event NETDEV_UP\n");
@@ -688,8 +695,7 @@
 	DPRINTK("atmarpd_close\n");
 	atmarpd = NULL; /* assumed to be atomic */
 	barrier();
-	unregister_inetaddr_notifier(&clip_inet_notifier);
-	unregister_netdevice_notifier(&clip_dev_notifier);
+
 	if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
 		printk(KERN_ERR "atmarpd_close: closing with requests "
 		    "pending\n");
@@ -731,10 +737,6 @@
 	vcc->push = NULL;
 	vcc->pop = NULL; /* crash */
 	vcc->push_oam = NULL; /* crash */
-	if (register_netdevice_notifier(&clip_dev_notifier))
-		printk(KERN_ERR "register_netdevice_notifier failed\n");
-	if (register_inetaddr_notifier(&clip_inet_notifier))
-		printk(KERN_ERR "register_inetaddr_notifier failed\n");
 	return 0;
 }
 
@@ -992,6 +994,8 @@
 
 	clip_tbl_hook = &clip_tbl;
 	register_atm_ioctl(&clip_ioctl_ops);
+	register_netdevice_notifier(&clip_dev_notifier);
+	register_inetaddr_notifier(&clip_inet_notifier);
 
 #ifdef CONFIG_PROC_FS
 {
@@ -1012,6 +1016,9 @@
 
 	remove_proc_entry("arp", atm_proc_root);
 
+	unregister_inetaddr_notifier(&clip_inet_notifier);
+	unregister_netdevice_notifier(&clip_dev_notifier);
+
 	deregister_atm_ioctl(&clip_ioctl_ops);
 
 	/* First, stop the idle timer, so it stops banging

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2006-04-14 23:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-12 17:55 [PATCH] atm: clip causes unregister hang Stephen Hemminger
2006-04-12 18:08 ` Herbert Xu
2006-04-12 19:45   ` Stephen Hemminger
2006-04-12 20:00     ` Herbert Xu
2006-04-12 20:15       ` Stephen Hemminger
2006-04-12 20:25         ` Herbert Xu
2006-04-12 21:52           ` Stephen Hemminger
2006-04-12 22:42             ` [PATCH] atm: clip timer race Stephen Hemminger
2006-04-13 12:45               ` Herbert Xu
2006-04-13 17:26                 ` Stephen Hemminger
2006-04-13 17:31                   ` Herbert Xu
2006-04-13 21:08                 ` Roland Dreier
2006-04-13 22:11                   ` Herbert Xu
2006-04-14 22:56               ` David S. Miller
2006-04-13 12:28             ` [PATCH] atm: clip causes unregister hang Herbert Xu
2006-04-14 22:07             ` David S. Miller
2006-04-13 22:22 ` [PATCH 1/4] clip: run through Lindent Stephen Hemminger
2006-04-13 22:24   ` [PATCH 4/4] clip: add module info Stephen Hemminger
2006-04-13 22:45   ` [stable] [PATCH 1/4] clip: run through Lindent Greg KH
2006-04-14  9:01     ` David S. Miller
2006-04-14 22:58   ` David S. Miller
2006-04-14 22:59   ` David S. Miller
     [not found] ` <20060413151945.0f181d04@localhost.localdomain>
2006-04-13 22:23   ` [PATCH 3/4] clip: notifier related cleanups Stephen Hemminger
2006-04-13 22:23   ` [PATCH 2/4] clip: get rid of PROC_FS ifdef Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).