diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2004-06-24 01:47:31 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2004-06-24 01:47:31 +0000 |
| commit | 53f9c5e988a14438e845b6a7684724420dbbf6d6 (patch) | |
| tree | 553905812afe6a5439f7e81526ddc734adb24359 /sys/netgraph | |
| parent | ad6b0efff5a33fca98e128c02617ea7c765a84d9 (diff) | |
Notes
Diffstat (limited to 'sys/netgraph')
| -rw-r--r-- | sys/netgraph/ng_base.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index d3acc0173796..f50f5f2306cf 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -170,6 +170,7 @@ static struct mtx ng_idhash_mtx; #define NG_IDHASH_FN(ID) ((ID) % (NG_ID_HASH_SIZE)) #define NG_IDHASH_FIND(ID, node) \ do { \ + mtx_assert(&ng_idhash_mtx, MA_OWNED); \ LIST_FOREACH(node, &ng_ID_hash[NG_IDHASH_FN(ID)], \ nd_idnodes) { \ if (NG_NODE_IS_VALID(node) \ @@ -3231,10 +3232,12 @@ ng_dumpnodes(void) { node_p node; int i = 1; + mtx_lock(&ng_nodelist_mtx); SLIST_FOREACH(node, &ng_allnodes, nd_all) { printf("[%d] ", i++); dumpnode(node, NULL, 0); } + mtx_unlock(&ng_nodelist_mtx); } static void @@ -3242,10 +3245,12 @@ ng_dumphooks(void) { hook_p hook; int i = 1; + mtx_lock(&ng_nodelist_mtx); SLIST_FOREACH(hook, &ng_allhooks, hk_all) { printf("[%d] ", i++); dumphook(hook, NULL, 0); } + mtx_unlock(&ng_nodelist_mtx); } static int |
