netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2][IPV6] addrconf: fix timer deleting on exit
@ 2007-07-05 11:12 Jarek Poplawski
  2007-07-05 11:37 ` [PATCH 2/2][IPV6] addrconf: fix addrconf_del_timer locking etc Jarek Poplawski
  2007-07-05 21:37 ` [PATCH 1/2][IPV6] addrconf: fix timer deleting on exit David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jarek Poplawski @ 2007-07-05 11:12 UTC (permalink / raw)
  To: netdev; +Cc: YOSHIFUJI Hideaki, David S. Miller, Herbert Xu


It looks like a timer function can be running and rearm
the timer after removing a ipv6 module.


Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>

---

diff -Nurp 2.6.22-rc7-/net/ipv6/addrconf.c 2.6.22-rc7/net/ipv6/addrconf.c
--- 2.6.22-rc7-/net/ipv6/addrconf.c	2007-07-02 09:03:29.000000000 +0200
+++ 2.6.22-rc7/net/ipv6/addrconf.c	2007-07-05 12:27:22.000000000 +0200
@@ -2957,8 +2957,11 @@ restart:
 		read_unlock(&addrconf_hash_lock);
 	}
 
-	addr_chk_timer.expires = time_before(next, jiffies + HZ) ? jiffies + HZ : next;
-	add_timer(&addr_chk_timer);
+	if (ipv6_dev_notf.notifier_call) {	/* exit time? */
+		addr_chk_timer.expires = time_before(next, jiffies + HZ)
+							? jiffies + HZ : next;
+		add_timer(&addr_chk_timer);
+	}
 	spin_unlock_bh(&addrconf_verify_lock);
 }
 
@@ -4281,9 +4284,13 @@ void __exit addrconf_cleanup(void)
 			 */
 		}
 	}
+
+	/* now exit flag for a timer... */
+	ipv6_dev_notf.notifier_call = NULL;
 	write_unlock_bh(&addrconf_hash_lock);
 
-	del_timer(&addr_chk_timer);
+	if (!del_timer_sync(&addr_chk_timer))
+		del_timer_sync(&addr_chk_timer);
 
 	rtnl_unlock();
 

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

end of thread, other threads:[~2007-07-06  5:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 11:12 [PATCH 1/2][IPV6] addrconf: fix timer deleting on exit Jarek Poplawski
2007-07-05 11:37 ` [PATCH 2/2][IPV6] addrconf: fix addrconf_del_timer locking etc Jarek Poplawski
2007-07-05 21:37 ` [PATCH 1/2][IPV6] addrconf: fix timer deleting on exit David Miller
2007-07-06  5:30   ` Jarek Poplawski

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).