In ng_netflow_disconnect() check whether we are working with "iface"

or with "out" hook, and clear the right pointer.

Reported by:	Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>
This commit is contained in:
Gleb Smirnoff 2005-12-28 12:56:59 +00:00
parent 4992df3ead
commit 747cdba40e

View File

@ -614,8 +614,12 @@ ng_netflow_disconnect(hook_p hook)
priv_p priv = NG_NODE_PRIVATE(node);
iface_p iface = NG_HOOK_PRIVATE(hook);
if (iface != NULL)
iface->hook = NULL;
if (iface != NULL) {
if (iface->hook == hook)
iface->hook = NULL;
if (iface->out == hook)
iface->out = NULL;
}
/* if export hook disconnected stop running expire(). */
if (hook == priv->export) {