diff options
Diffstat (limited to 'usr/src/uts/common/os/netstack.c')
-rw-r--r-- | usr/src/uts/common/os/netstack.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/netstack.c b/usr/src/uts/common/os/netstack.c index 5c556bffef..1bed9d7406 100644 --- a/usr/src/uts/common/os/netstack.c +++ b/usr/src/uts/common/os/netstack.c @@ -22,7 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2016, Joyent, Inc. All rights reserved. */ #include <sys/param.h> @@ -340,7 +340,7 @@ netstack_zone_create(zoneid_t zoneid) /* * Should never find a pre-existing exclusive stack */ - ASSERT(stackid == GLOBAL_NETSTACKID); + VERIFY(stackid == GLOBAL_NETSTACKID); kmem_free(ns, sizeof (netstack_t)); ns = *nsp; mutex_enter(&ns->netstack_lock); @@ -1041,6 +1041,26 @@ netstack_find_by_stackid(netstackid_t stackid) return (NULL); } +boolean_t +netstack_inuse_by_stackid(netstackid_t stackid) +{ + netstack_t *ns; + boolean_t rval = B_FALSE; + + mutex_enter(&netstack_g_lock); + + for (ns = netstack_head; ns != NULL; ns = ns->netstack_next) { + if (ns->netstack_stackid == stackid) { + rval = B_TRUE; + break; + } + } + + mutex_exit(&netstack_g_lock); + + return (rval); +} + void netstack_rele(netstack_t *ns) { |