Date: Wed, 9 Feb 2005 15:14:44 +0000 (UTC) From: Ruslan Ermilov <ru@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/netgraph ng_bridge.c Message-ID: <200502091514.j19FEiZM088086@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
ru 2005-02-09 15:14:44 UTC
FreeBSD src repository
Modified files:
sys/netgraph ng_bridge.c
Log:
In revision 1.29 timeout() was converted to ng_callout().
The difference is that the callout function installed via the
ng_callout() method is guaranteed to NOT fire after the shutdown
method was run (when a node is marked NGF_INVALID). Also, the
shutdown method and the callout function are guaranteed to NOT
run at the same time, as both require the writer lock. Thus
we can safely ignore a zero return value from ng_uncallout()
(callout_stop()) in shutdown methods, and go on with freeing
the node.
The said revision broke the node shutdown -- ng_bridge_timeout()
is no longer fired after ng_bridge_shutdown() was run, resulting
in a memory leak, dead nodes, and inability to unload the module.
Fix this by cancelling the callout on shutdown, and moving part
responsible for freeing a node resources from ng_bridge_timer()
to ng_bridge_shutdown().
Noticed by: ru
Submitted by: glebius, ru
Revision Changes Path
1.31 +9 -15 src/sys/netgraph/ng_bridge.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502091514.j19FEiZM088086>
