Run expire even without export hook connected.

PR:	kern/119839
This commit is contained in:
Alexander Motin 2008-01-27 15:01:16 +00:00
parent 73981c381a
commit 57f2b25dfa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175721

View File

@ -190,6 +190,9 @@ ng_netflow_constructor(node_p node)
if ((error = ng_netflow_cache_init(priv)))
return (error);
/* Schedule expiry. */
callout_reset(&priv->exp_callout, (1*hz), &ng_netflow_expire,
(void *)priv);
return (0);
}
@ -275,10 +278,6 @@ ng_netflow_newhook(node_p node, hook_p hook, const char *name)
*/
NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
#endif
/* Exporter is ready. Let's schedule expiry. */
callout_reset(&priv->exp_callout, (1*hz), &ng_netflow_expire,
(void *)priv);
} else
return (EINVAL);
@ -650,11 +649,8 @@ ng_netflow_disconnect(hook_p hook)
iface->out = NULL;
}
/* if export hook disconnected stop running expire(). */
if (hook == priv->export) {
callout_drain(&priv->exp_callout);
if (hook == priv->export)
priv->export = NULL;
}
/* Removal of the last link destroys the node. */
if (NG_NODE_NUMHOOKS(node) == 0)