summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_base.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-05-29 07:21:46 +0000
committerjulian <julian@FreeBSD.org>2004-05-29 07:21:46 +0000
commit14e22ae790f0931cfc80145d29b654521b3a3a10 (patch)
tree67609d746180f3ac3b3714e8dcaba00a354b8f02 /sys/netgraph/ng_base.c
parent9fc4e00a1cc5858d10a3b68a9861213b649ccb04 (diff)
downloadFreeBSD-src-14e22ae790f0931cfc80145d29b654521b3a3a10.zip
FreeBSD-src-14e22ae790f0931cfc80145d29b654521b3a3a10.tar.gz
Add a new netgraph method to allow restoration of some
behaviour lost in the change from 4.x style netgraph tee nodes. Alter the tee node to use the new method. Document the behaviour. Step the ABI version number... old netgraph klds will refuse to load. Better than just crashing. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
Diffstat (limited to 'sys/netgraph/ng_base.c')
-rw-r--r--sys/netgraph/ng_base.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 878ec88..d3acc01 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -199,7 +199,6 @@ static int ng_mkpeer(node_p node, const char *name,
const char *name2, char *type);
/* imported , these used to be externally visible, some may go back */
-int ng_bypass(hook_p hook1, hook_p hook2);
void ng_destroy_hook(hook_p hook);
node_p ng_name2noderef(node_p node, const char *name);
int ng_path2noderef(node_p here, const char *path,
@@ -694,6 +693,10 @@ ng_rmnode(node_p node, hook_p dummy1, void *dummy2, int dummy3)
*/
node->nd_flags |= NG_INVALID|NG_CLOSING;
+ /* If node has its pre-shutdown method, then call it first*/
+ if (node->nd_type && node->nd_type->close)
+ (*node->nd_type->close)(node);
+
/* Notify all remaining connected nodes to disconnect */
while ((hook = LIST_FIRST(&node->nd_hooks)) != NULL)
ng_destroy_hook(hook);
OpenPOWER on IntegriCloud