style(9), whitespace and spelling nits.

This commit is contained in:
Gleb Smirnoff 2011-12-30 15:41:28 +00:00
parent 999f397284
commit 4bd1b55756

View File

@ -1,7 +1,3 @@
/*
* ng_base.c
*/
/*- /*-
* Copyright (c) 1996-1999 Whistle Communications, Inc. * Copyright (c) 1996-1999 Whistle Communications, Inc.
* All rights reserved. * All rights reserved.
@ -333,18 +329,18 @@ ng_alloc_node(void)
#define NG_FREE_HOOK(hook) \ #define NG_FREE_HOOK(hook) \
do { \ do { \
mtx_lock(&ng_nodelist_mtx); \ mtx_lock(&ng_nodelist_mtx); \
LIST_INSERT_HEAD(&ng_freehooks, hook, hk_hooks); \ LIST_INSERT_HEAD(&ng_freehooks, hook, hk_hooks); \
hook->hk_magic = 0; \ hook->hk_magic = 0; \
mtx_unlock(&ng_nodelist_mtx); \ mtx_unlock(&ng_nodelist_mtx); \
} while (0) } while (0)
#define NG_FREE_NODE(node) \ #define NG_FREE_NODE(node) \
do { \ do { \
mtx_lock(&ng_nodelist_mtx); \ mtx_lock(&ng_nodelist_mtx); \
LIST_INSERT_HEAD(&ng_freenodes, node, nd_nodes); \ LIST_INSERT_HEAD(&ng_freenodes, node, nd_nodes); \
node->nd_magic = 0; \ node->nd_magic = 0; \
mtx_unlock(&ng_nodelist_mtx); \ mtx_unlock(&ng_nodelist_mtx); \
} while (0) } while (0)
#else /* NETGRAPH_DEBUG */ /*----------------------------------------------*/ #else /* NETGRAPH_DEBUG */ /*----------------------------------------------*/
@ -670,8 +666,8 @@ ng_make_node_common(struct ng_type *type, node_p *nodepp)
break; break;
} }
} }
LIST_INSERT_HEAD(&V_ng_ID_hash[NG_IDHASH_FN(node->nd_ID)], LIST_INSERT_HEAD(&V_ng_ID_hash[NG_IDHASH_FN(node->nd_ID)], node,
node, nd_idnodes); nd_idnodes);
mtx_unlock(&ng_idhash_mtx); mtx_unlock(&ng_idhash_mtx);
/* Done */ /* Done */
@ -824,7 +820,7 @@ ng_node2ID(node_p node)
************************************************************************/ ************************************************************************/
/* /*
* Assign a node a name. Once assigned, the name cannot be changed. * Assign a node a name.
*/ */
int int
ng_name_node(node_p node, const char *name) ng_name_node(node_p node, const char *name)
@ -921,27 +917,21 @@ ng_decodeidname(const char *name)
u_long val; u_long val;
/* Check for proper length, brackets, no leading junk */ /* Check for proper length, brackets, no leading junk */
if ((len < 3) if ((len < 3) || (name[0] != '[') || (name[len - 1] != ']') ||
|| (name[0] != '[') (!isxdigit(name[1])))
|| (name[len - 1] != ']')
|| (!isxdigit(name[1]))) {
return ((ng_ID_t)0); return ((ng_ID_t)0);
}
/* Decode number */ /* Decode number */
val = strtoul(name + 1, &eptr, 16); val = strtoul(name + 1, &eptr, 16);
if ((eptr - name != len - 1) if ((eptr - name != len - 1) || (val == ULONG_MAX) || (val == 0))
|| (val == ULONG_MAX)
|| (val == 0)) {
return ((ng_ID_t)0); return ((ng_ID_t)0);
}
return (ng_ID_t)val; return ((ng_ID_t)val);
} }
/* /*
* Remove a name from a node. This should only be called * Remove a name from a node. This should only be called
* when shutting down and removing the node. * when shutting down and removing the node.
* IF we allow name changing this may be more resurrected.
*/ */
void void
ng_unname(node_p node) ng_unname(node_p node)
@ -1045,8 +1035,8 @@ ng_findhook(node_p node, const char *name)
if (node->nd_type->findhook != NULL) if (node->nd_type->findhook != NULL)
return (*node->nd_type->findhook)(node, name); return (*node->nd_type->findhook)(node, name);
LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) {
if (NG_HOOK_IS_VALID(hook) if (NG_HOOK_IS_VALID(hook) &&
&& (strcmp(NG_HOOK_NAME(hook), name) == 0)) (strcmp(NG_HOOK_NAME(hook), name) == 0))
return (hook); return (hook);
} }
return (NULL); return (NULL);
@ -1182,12 +1172,12 @@ ng_newtype(struct ng_type *tp)
const size_t namelen = strlen(tp->name); const size_t namelen = strlen(tp->name);
/* Check version and type name fields */ /* Check version and type name fields */
if ((tp->version != NG_ABI_VERSION) if ((tp->version != NG_ABI_VERSION) || (namelen == 0) ||
|| (namelen == 0) (namelen >= NG_TYPESIZ)) {
|| (namelen >= NG_TYPESIZ)) {
TRAP_ERROR(); TRAP_ERROR();
if (tp->version != NG_ABI_VERSION) { if (tp->version != NG_ABI_VERSION) {
printf("Netgraph: Node type rejected. ABI mismatch. Suggest recompile\n"); printf("Netgraph: Node type rejected. ABI mismatch. "
"Suggest recompile\n");
} }
return (EINVAL); return (EINVAL);
} }
@ -1635,8 +1625,8 @@ ng_path_parse(char *addr, char **nodep, char **pathp, char **hookp)
* return the destination node. * return the destination node.
*/ */
int int
ng_path2noderef(node_p here, const char *address, ng_path2noderef(node_p here, const char *address, node_p *destp,
node_p *destp, hook_p *lasthook) hook_p *lasthook)
{ {
char fullpath[NG_PATHSIZ]; char fullpath[NG_PATHSIZ];
char *nodename, *path; char *nodename, *path;
@ -1715,10 +1705,9 @@ ng_path2noderef(node_p here, const char *address,
mtx_lock(&ng_topo_mtx); mtx_lock(&ng_topo_mtx);
/* Can't get there from here... */ /* Can't get there from here... */
if (hook == NULL if (hook == NULL || NG_HOOK_PEER(hook) == NULL ||
|| NG_HOOK_PEER(hook) == NULL NG_HOOK_NOT_VALID(hook) ||
|| NG_HOOK_NOT_VALID(hook) NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))) {
|| NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))) {
TRAP_ERROR(); TRAP_ERROR();
NG_NODE_UNREF(node); NG_NODE_UNREF(node);
mtx_unlock(&ng_topo_mtx); mtx_unlock(&ng_topo_mtx);
@ -1882,9 +1871,9 @@ ng_dequeue(node_p node, int *rw)
long t = ngq->q_flags; long t = ngq->q_flags;
if (t & WRITER_ACTIVE) { if (t & WRITER_ACTIVE) {
/* There is writer, reader can't proceed. */ /* There is writer, reader can't proceed. */
CTR4(KTR_NET, "%20s: node [%x] (%p) queued reader " CTR4(KTR_NET, "%20s: node [%x] (%p) queued "
"can't proceed; queue flags 0x%lx", __func__, "reader can't proceed; queue flags 0x%lx",
node->nd_ID, node, t); __func__, node->nd_ID, node, t);
return (NULL); return (NULL);
} }
if (atomic_cmpset_acq_int(&ngq->q_flags, t, if (atomic_cmpset_acq_int(&ngq->q_flags, t,
@ -1900,9 +1889,9 @@ ng_dequeue(node_p node, int *rw)
*rw = NGQRW_W; *rw = NGQRW_W;
} else { } else {
/* There is somebody other, writer can't proceed. */ /* There is somebody other, writer can't proceed. */
CTR4(KTR_NET, "%20s: node [%x] (%p) queued writer " CTR4(KTR_NET, "%20s: node [%x] (%p) queued writer can't "
"can't proceed; queue flags 0x%lx", __func__, "proceed; queue flags 0x%lx", __func__, node->nd_ID, node,
node->nd_ID, node, ngq->q_flags); ngq->q_flags);
return (NULL); return (NULL);
} }
@ -1914,10 +1903,9 @@ ng_dequeue(node_p node, int *rw)
STAILQ_REMOVE_HEAD(&ngq->queue, el_next); STAILQ_REMOVE_HEAD(&ngq->queue, el_next);
if (STAILQ_EMPTY(&ngq->queue)) if (STAILQ_EMPTY(&ngq->queue))
atomic_clear_int(&ngq->q_flags, OP_PENDING); atomic_clear_int(&ngq->q_flags, OP_PENDING);
CTR6(KTR_NET, "%20s: node [%x] (%p) returning item %p as %s; " CTR6(KTR_NET, "%20s: node [%x] (%p) returning item %p as %s; queue "
"queue flags 0x%lx", __func__, "flags 0x%lx", __func__, node->nd_ID, node, item, *rw ? "WRITER" :
node->nd_ID, node, item, *rw ? "WRITER" : "READER" , "READER", ngq->q_flags);
ngq->q_flags);
return (item); return (item);
} }
@ -1941,7 +1929,7 @@ ng_queue_rw(node_p node, item_p item, int rw)
CTR5(KTR_NET, "%20s: node [%x] (%p) queued item %p as %s", __func__, CTR5(KTR_NET, "%20s: node [%x] (%p) queued item %p as %s", __func__,
node->nd_ID, node, item, rw ? "WRITER" : "READER" ); node->nd_ID, node, item, rw ? "WRITER" : "READER" );
/* /*
* We can take the worklist lock with the node locked * We can take the worklist lock with the node locked
* BUT NOT THE REVERSE! * BUT NOT THE REVERSE!
@ -1959,12 +1947,12 @@ ng_acquire_read(node_p node, item_p item)
("%s: working on deadnode", __func__)); ("%s: working on deadnode", __func__));
/* Reader needs node without writer and pending items. */ /* Reader needs node without writer and pending items. */
while (1) { for (;;) {
long t = node->nd_input_queue.q_flags; long t = node->nd_input_queue.q_flags;
if (t & NGQ_RMASK) if (t & NGQ_RMASK)
break; /* Node is not ready for reader. */ break; /* Node is not ready for reader. */
if (atomic_cmpset_acq_int(&node->nd_input_queue.q_flags, if (atomic_cmpset_acq_int(&node->nd_input_queue.q_flags, t,
t, t + READER_INCREMENT)) { t + READER_INCREMENT)) {
/* Successfully grabbed node */ /* Successfully grabbed node */
CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p", CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p",
__func__, node->nd_ID, node, item); __func__, node->nd_ID, node, item);
@ -1987,8 +1975,8 @@ ng_acquire_write(node_p node, item_p item)
("%s: working on deadnode", __func__)); ("%s: working on deadnode", __func__));
/* Writer needs completely idle node. */ /* Writer needs completely idle node. */
if (atomic_cmpset_acq_int(&node->nd_input_queue.q_flags, if (atomic_cmpset_acq_int(&node->nd_input_queue.q_flags, 0,
0, WRITER_ACTIVE)) { WRITER_ACTIVE)) {
/* Successfully grabbed node */ /* Successfully grabbed node */
CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p", CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p",
__func__, node->nd_ID, node, item); __func__, node->nd_ID, node, item);
@ -2032,11 +2020,10 @@ ng_upgrade_write(node_p node, item_p item)
ng_apply_item(node, item, 0); ng_apply_item(node, item, 0);
/* /*
* Having acted on the item, atomically * Having acted on the item, atomically
* down grade back to READER and finish up * downgrade back to READER and finish up.
*/ */
atomic_add_int(&ngq->q_flags, atomic_add_int(&ngq->q_flags, READER_INCREMENT - WRITER_ACTIVE);
READER_INCREMENT - WRITER_ACTIVE);
/* Our caller will call ng_leave_read() */ /* Our caller will call ng_leave_read() */
return; return;
@ -2204,11 +2191,10 @@ ng_snd_item(item_p item, int flags)
size_t st, su, sl; size_t st, su, sl;
GET_STACK_USAGE(st, su); GET_STACK_USAGE(st, su);
sl = st - su; sl = st - su;
if ((sl * 4 < st) || if ((sl * 4 < st) || ((sl * 2 < st) &&
((sl * 2 < st) && ((node->nd_flags & NGF_HI_STACK) || ((node->nd_flags & NGF_HI_STACK) || (hook &&
(hook && (hook->hk_flags & HK_HI_STACK))))) { (hook->hk_flags & HK_HI_STACK)))))
queue = 1; queue = 1;
}
#endif #endif
} }
@ -2310,10 +2296,10 @@ ng_apply_item(node_p node, item_p item, int rw)
} }
/* /*
* If no receive method, just silently drop it. * If no receive method, just silently drop it.
* Give preference to the hook over-ride method * Give preference to the hook over-ride method.
*/ */
if ((!(rcvdata = hook->hk_rcvdata)) if ((!(rcvdata = hook->hk_rcvdata)) &&
&& (!(rcvdata = NG_HOOK_NODE(hook)->nd_type->rcvdata))) { (!(rcvdata = NG_HOOK_NODE(hook)->nd_type->rcvdata))) {
error = 0; error = 0;
NG_FREE_ITEM(item); NG_FREE_ITEM(item);
break; break;
@ -2533,8 +2519,8 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
hook_p hook; hook_p hook;
/* Get response struct */ /* Get response struct */
NG_MKRESPONSE(resp, msg, sizeof(*hl) NG_MKRESPONSE(resp, msg, sizeof(*hl) +
+ (nhooks * sizeof(struct linkinfo)), M_NOWAIT); (nhooks * sizeof(struct linkinfo)), M_NOWAIT);
if (resp == NULL) { if (resp == NULL) {
error = ENOMEM; error = ENOMEM;
break; break;
@ -2595,8 +2581,8 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
mtx_unlock(&ng_namehash_mtx); mtx_unlock(&ng_namehash_mtx);
/* Get response struct */ /* Get response struct */
NG_MKRESPONSE(resp, msg, sizeof(*nl) NG_MKRESPONSE(resp, msg, sizeof(*nl) +
+ (num * sizeof(struct nodeinfo)), M_NOWAIT); (num * sizeof(struct nodeinfo)), M_NOWAIT);
if (resp == NULL) { if (resp == NULL) {
error = ENOMEM; error = ENOMEM;
break; break;
@ -2646,8 +2632,8 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
mtx_unlock(&ng_typelist_mtx); mtx_unlock(&ng_typelist_mtx);
/* Get response struct */ /* Get response struct */
NG_MKRESPONSE(resp, msg, sizeof(*tl) NG_MKRESPONSE(resp, msg, sizeof(*tl) +
+ (num * sizeof(struct typeinfo)), M_NOWAIT); (num * sizeof(struct typeinfo)), M_NOWAIT);
if (resp == NULL) { if (resp == NULL) {
error = ENOMEM; error = ENOMEM;
break; break;
@ -2702,16 +2688,16 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
bcopy(binary, ascii, sizeof(*binary)); bcopy(binary, ascii, sizeof(*binary));
/* Find command by matching typecookie and command number */ /* Find command by matching typecookie and command number */
for (c = here->nd_type->cmdlist; for (c = here->nd_type->cmdlist; c != NULL && c->name != NULL;
c != NULL && c->name != NULL; c++) { c++) {
if (binary->header.typecookie == c->cookie if (binary->header.typecookie == c->cookie &&
&& binary->header.cmd == c->cmd) binary->header.cmd == c->cmd)
break; break;
} }
if (c == NULL || c->name == NULL) { if (c == NULL || c->name == NULL) {
for (c = ng_generic_cmds; c->name != NULL; c++) { for (c = ng_generic_cmds; c->name != NULL; c++) {
if (binary->header.typecookie == c->cookie if (binary->header.typecookie == c->cookie &&
&& binary->header.cmd == c->cmd) binary->header.cmd == c->cmd)
break; break;
} }
if (c->name == NULL) { if (c->name == NULL) {
@ -2805,8 +2791,8 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
if (argstype == NULL) { if (argstype == NULL) {
bufSize = 0; bufSize = 0;
} else { } else {
if ((error = ng_parse(argstype, ascii->data, if ((error = ng_parse(argstype, ascii->data, &off,
&off, (u_char *)binary->data, &bufSize)) != 0) { (u_char *)binary->data, &bufSize)) != 0) {
NG_FREE_MSG(resp); NG_FREE_MSG(resp);
break; break;
} }
@ -2837,7 +2823,7 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
} }
/* /*
* Sometimes a generic message may be statically allocated * Sometimes a generic message may be statically allocated
* to avoid problems with allocating when in tight memeory situations. * to avoid problems with allocating when in tight memory situations.
* Don't free it if it is so. * Don't free it if it is so.
* I break them appart here, because erros may cause a free if the item * I break them appart here, because erros may cause a free if the item
* in which case we'd be doing it twice. * in which case we'd be doing it twice.
@ -2871,7 +2857,7 @@ SYSCTL_INT(_net_graph, OID_AUTO, maxdata, CTLFLAG_RDTUN, &maxdata,
#ifdef NETGRAPH_DEBUG #ifdef NETGRAPH_DEBUG
static TAILQ_HEAD(, ng_item) ng_itemlist = TAILQ_HEAD_INITIALIZER(ng_itemlist); static TAILQ_HEAD(, ng_item) ng_itemlist = TAILQ_HEAD_INITIALIZER(ng_itemlist);
static int allocated; /* number of items malloc'd */ static int allocated; /* number of items malloc'd */
#endif #endif
/* /*
@ -2889,7 +2875,7 @@ ng_alloc_item(int type, int flags)
KASSERT(((type & ~NGQF_TYPE) == 0), KASSERT(((type & ~NGQF_TYPE) == 0),
("%s: incorrect item type: %d", __func__, type)); ("%s: incorrect item type: %d", __func__, type));
item = uma_zalloc((type == NGQF_DATA)?ng_qdzone:ng_qzone, item = uma_zalloc((type == NGQF_DATA) ? ng_qdzone : ng_qzone,
((flags & NG_WAITOK) ? M_WAITOK : M_NOWAIT) | M_ZERO); ((flags & NG_WAITOK) ? M_WAITOK : M_NOWAIT) | M_ZERO);
if (item) { if (item) {
@ -2945,8 +2931,8 @@ ng_free_item(item_p item)
allocated--; allocated--;
mtx_unlock(&ngq_mtx); mtx_unlock(&ngq_mtx);
#endif #endif
uma_zfree(((item->el_flags & NGQF_TYPE) == NGQF_DATA)? uma_zfree(((item->el_flags & NGQF_TYPE) == NGQF_DATA) ?
ng_qdzone:ng_qzone, item); ng_qdzone : ng_qzone, item);
} }
/* /*
@ -2991,17 +2977,14 @@ int
ng_mod_event(module_t mod, int event, void *data) ng_mod_event(module_t mod, int event, void *data)
{ {
struct ng_type *const type = data; struct ng_type *const type = data;
int s, error = 0; int error = 0;
switch (event) { switch (event) {
case MOD_LOAD: case MOD_LOAD:
/* Register new netgraph node type */ /* Register new netgraph node type */
s = splnet(); if ((error = ng_newtype(type)) != 0)
if ((error = ng_newtype(type)) != 0) {
splx(s);
break; break;
}
/* Call type specific code */ /* Call type specific code */
if (type->mod_event != NULL) if (type->mod_event != NULL)
@ -3011,31 +2994,23 @@ ng_mod_event(module_t mod, int event, void *data)
LIST_REMOVE(type, types); LIST_REMOVE(type, types);
mtx_unlock(&ng_typelist_mtx); mtx_unlock(&ng_typelist_mtx);
} }
splx(s);
break; break;
case MOD_UNLOAD: case MOD_UNLOAD:
s = splnet();
if (type->refs > 1) { /* make sure no nodes exist! */ if (type->refs > 1) { /* make sure no nodes exist! */
error = EBUSY; error = EBUSY;
} else { } else {
if (type->refs == 0) { if (type->refs == 0) /* failed load, nothing to undo */
/* failed load, nothing to undo */
splx(s);
break; break;
}
if (type->mod_event != NULL) { /* check with type */ if (type->mod_event != NULL) { /* check with type */
error = (*type->mod_event)(mod, event, data); error = (*type->mod_event)(mod, event, data);
if (error != 0) { /* type refuses.. */ if (error != 0) /* type refuses.. */
splx(s);
break; break;
}
} }
mtx_lock(&ng_typelist_mtx); mtx_lock(&ng_typelist_mtx);
LIST_REMOVE(type, types); LIST_REMOVE(type, types);
mtx_unlock(&ng_typelist_mtx); mtx_unlock(&ng_typelist_mtx);
} }
splx(s);
break; break;
default: default:
@ -3048,7 +3023,7 @@ ng_mod_event(module_t mod, int event, void *data)
return (error); return (error);
} }
#ifdef VIMAGE #ifdef VIMAGE
static void static void
vnet_netgraph_uninit(const void *unused __unused) vnet_netgraph_uninit(const void *unused __unused)
{ {
@ -3074,8 +3049,8 @@ vnet_netgraph_uninit(const void *unused __unused)
if (node != NULL) { if (node != NULL) {
if (node == last_killed) { if (node == last_killed) {
/* This should never happen */ /* This should never happen */
printf("ng node %s needs" printf("ng node %s needs NGF_REALLY_DIE\n",
"NGF_REALLY_DIE\n", node->nd_name); node->nd_name);
if (node->nd_flags & NGF_REALLY_DIE) if (node->nd_flags & NGF_REALLY_DIE)
panic("ng node %s won't die", panic("ng node %s won't die",
node->nd_name); node->nd_name);
@ -3123,8 +3098,9 @@ ngb_mod_event(module_t mod, int event, void *data)
ng_qzone = uma_zcreate("NetGraph items", sizeof(struct ng_item), ng_qzone = uma_zcreate("NetGraph items", sizeof(struct ng_item),
NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0);
uma_zone_set_max(ng_qzone, maxalloc); uma_zone_set_max(ng_qzone, maxalloc);
ng_qdzone = uma_zcreate("NetGraph data items", sizeof(struct ng_item), ng_qdzone = uma_zcreate("NetGraph data items",
NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); sizeof(struct ng_item), NULL, NULL, NULL, NULL,
UMA_ALIGN_CACHE, 0);
uma_zone_set_max(ng_qdzone, maxdata); uma_zone_set_max(ng_qdzone, maxdata);
/* Autoconfigure number of threads. */ /* Autoconfigure number of threads. */
if (numthreads <= 0) if (numthreads <= 0)
@ -3365,7 +3341,7 @@ ng_worklist_add(node_p node)
* then put us on. * then put us on.
*/ */
node->nd_input_queue.q_flags2 |= NGQ2_WORKQ; node->nd_input_queue.q_flags2 |= NGQ2_WORKQ;
NG_NODE_REF(node); /* XXX fafe in mutex? */ NG_NODE_REF(node); /* XXX safe in mutex? */
NG_WORKLIST_LOCK(); NG_WORKLIST_LOCK();
STAILQ_INSERT_TAIL(&ng_worklist, node, nd_input_queue.q_work); STAILQ_INSERT_TAIL(&ng_worklist, node, nd_input_queue.q_work);
NG_WORKLIST_UNLOCK(); NG_WORKLIST_UNLOCK();
@ -3493,8 +3469,7 @@ ng_address_hook(node_p here, item_p item, hook_p hook, ng_ID_t retaddr)
* that the peer node is present, though maybe invalid. * that the peer node is present, though maybe invalid.
*/ */
mtx_lock(&ng_topo_mtx); mtx_lock(&ng_topo_mtx);
if ((hook == NULL) || if ((hook == NULL) || NG_HOOK_NOT_VALID(hook) ||
NG_HOOK_NOT_VALID(hook) ||
NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) || NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) ||
NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) { NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) {
NG_FREE_ITEM(item); NG_FREE_ITEM(item);
@ -3786,4 +3761,3 @@ ng_macro_test(item_p item)
NG_FWD_MSG_HOOK(error, node, item, hook, retaddr); NG_FWD_MSG_HOOK(error, node, item, hook, retaddr);
} }
#endif /* TESTING */ #endif /* TESTING */