diff options
author | mav <mav@FreeBSD.org> | 2007-08-18 11:59:17 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2007-08-18 11:59:17 +0000 |
commit | 093e149434fed9c6690336caca829b093bdc4309 (patch) | |
tree | 1a34ea41f65be37c1442c33b13bee950157bc166 /sys | |
parent | 84cb1143df95ba15f9ad6820d575d0ebe496e096 (diff) | |
download | FreeBSD-src-093e149434fed9c6690336caca829b093bdc4309.zip FreeBSD-src-093e149434fed9c6690336caca829b093bdc4309.tar.gz |
Add ng_send_fn() error handeling inside ng_con_nodes().
Without it some errors may left unnoticed and unhandeled
that will lead to hooks left in half-connected state.
Reviewed by: julian@
Approved by: re (kensmith), glebius (mentor)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netgraph/ng_base.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 4999293..7708bc1 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -1391,11 +1391,14 @@ ng_con_nodes(node_p node, const char *name, node_p node2, const char *name2) * Procesing continues in that function in the lock context of * the other node. */ - ng_send_fn(node2, hook2, &ng_con_part2, NULL, 0); + if ((error = ng_send_fn(node2, hook2, &ng_con_part2, NULL, 0))) { + printf("failed in ng_con_nodes(): %d\n", error); + ng_destroy_hook(hook); /* also zaps peer */ + } NG_HOOK_UNREF(hook); /* Let each hook go if it wants to */ NG_HOOK_UNREF(hook2); - return (0); + return (error); } /* |