netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, chas@cmf.nrl.navy.mil,
	linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
	stable@kernel.org
Subject: [PATCH] atm: clip causes unregister hang
Date: Wed, 12 Apr 2006 12:45:33 -0700	[thread overview]
Message-ID: <20060412124533.14e0c4ff@localhost.localdomain> (raw)
In-Reply-To: <E1FTjlM-00050V-00@gondolin.me.apana.org.au>

If Classical IP over ATM module is loaded, 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.

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 11:22:47.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_UNREGISTER) {
+		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

  reply	other threads:[~2006-04-12 19:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060412124533.14e0c4ff@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).