summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/netflow
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2008-02-03 10:30:45 +0000
committermav <mav@FreeBSD.org>2008-02-03 10:30:45 +0000
commit45f131f91d7b5b5e92e01cf6a4d5e5c222b5b319 (patch)
treeaca4e03f0f1cb6e4868f2f1d499842382f2ece37 /sys/netgraph/netflow
parentc8400e0702fb831bf234c03b35c1df8360712b48 (diff)
downloadFreeBSD-src-45f131f91d7b5b5e92e01cf6a4d5e5c222b5b319.zip
FreeBSD-src-45f131f91d7b5b5e92e01cf6a4d5e5c222b5b319.tar.gz
Revert previous commit.
glebius@ noticed that it was not a bug, but undocumented feature.
Diffstat (limited to 'sys/netgraph/netflow')
-rw-r--r--sys/netgraph/netflow/ng_netflow.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c
index 973d5be..c67d90b 100644
--- a/sys/netgraph/netflow/ng_netflow.c
+++ b/sys/netgraph/netflow/ng_netflow.c
@@ -190,9 +190,6 @@ 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);
}
@@ -278,6 +275,10 @@ 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);
@@ -649,8 +650,11 @@ ng_netflow_disconnect(hook_p hook)
iface->out = NULL;
}
- if (hook == priv->export)
+ /* if export hook disconnected stop running expire(). */
+ if (hook == priv->export) {
+ callout_drain(&priv->exp_callout);
priv->export = NULL;
+ }
/* Removal of the last link destroys the node. */
if (NG_NODE_NUMHOOKS(node) == 0)
OpenPOWER on IntegriCloud