diff options
author | julian <julian@FreeBSD.org> | 1999-10-27 11:48:35 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-10-27 11:48:35 +0000 |
commit | d65bad1ec7cf22cddce5cce6a05f0f38bd3487a0 (patch) | |
tree | 731d86bf345573df196d160f903ac5d67581c9c8 | |
parent | 144be1740d6096fd4154d3724db2fdae71a8a939 (diff) | |
download | FreeBSD-src-d65bad1ec7cf22cddce5cce6a05f0f38bd3487a0.zip FreeBSD-src-d65bad1ec7cf22cddce5cce6a05f0f38bd3487a0.tar.gz |
The node goes away when last session disconnects or when disconnected from
the ethernet node.
-rw-r--r-- | sys/netgraph/ng_pppoe.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 2d3bb62..8312c09 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -1253,12 +1253,14 @@ ng_pppoe_disconnect(hook_p hook) node_p node = hook->node; priv_p privp = node->private; sessp sp; + int hooks; AAA if (hook->private == &privp->debug_hook) { privp->debug_hook = NULL; } else if (hook->private == &privp->ethernet_hook) { privp->ethernet_hook = NULL; + ng_rmnode(node); } else { sp = hook->private; if (sp->state != PPPOE_SNONE ) { @@ -1302,6 +1304,13 @@ AAA } FREE(sp, M_NETGRAPH); hook->private = NULL; + /* work out how many session hooks there are + /* Node goes away on last session hook removal */ + hooks = node->numhooks; /* this one already not counted */ + if (privp->ethernet_hook) hooks -= 1; + if (privp->debug) hooks -= 1; + if (hooks == 0) + ng_rmnode(node); } if (node->numhooks == 0) ng_rmnode(node); |