cvs commit: src/sys/netgraph ng_bridge.c
Ruslan Ermilov
ru at FreeBSD.org
Wed Feb 9 15:14:45 GMT 2005
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
More information about the cvs-src
mailing list