summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_bus.c8
-rw-r--r--sys/net/if.c9
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket.c4
-rw-r--r--sys/netgraph/ng_base.c3
4 files changed, 19 insertions, 5 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index f196c8b..717ded4 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/interrupt.h>
+#include <net/vnet.h>
+
#include <machine/stdarg.h>
#include <vm/uma.h>
@@ -2735,7 +2737,11 @@ device_probe_and_attach(device_t dev)
return (0);
else if (error != 0)
return (error);
- return (device_attach(dev));
+
+ CURVNET_SET_QUIET(vnet0);
+ error = device_attach(dev);
+ CURVNET_RESTORE();
+ return error;
}
/**
diff --git a/sys/net/if.c b/sys/net/if.c
index 326860d..2cb3da0 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -505,6 +505,7 @@ if_free(struct ifnet *ifp)
ifp->if_flags |= IFF_DYING; /* XXX: Locking */
+ CURVNET_SET_QUIET(ifp->if_vnet);
IFNET_WLOCK();
KASSERT(ifp == ifnet_byindex_locked(ifp->if_index),
("%s: freeing unallocated ifnet", ifp->if_xname));
@@ -512,9 +513,9 @@ if_free(struct ifnet *ifp)
ifindex_free_locked(ifp->if_index);
IFNET_WUNLOCK();
- if (!refcount_release(&ifp->if_refcount))
- return;
- if_free_internal(ifp);
+ if (refcount_release(&ifp->if_refcount))
+ if_free_internal(ifp);
+ CURVNET_RESTORE();
}
/*
@@ -803,7 +804,9 @@ void
if_detach(struct ifnet *ifp)
{
+ CURVNET_SET_QUIET(ifp->if_vnet);
if_detach_internal(ifp, 0);
+ CURVNET_RESTORE();
}
static void
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket.c b/sys/netgraph/bluetooth/socket/ng_btsocket.c
index f1620bc..d0f1246 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket.c
@@ -46,6 +46,8 @@
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
+#include <net/vnet.h>
+
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/bluetooth/include/ng_bluetooth.h>
@@ -285,4 +287,4 @@ ng_btsocket_modevent(module_t mod, int event, void *data)
return (error);
} /* ng_btsocket_modevent */
-DOMAIN_SET(ng_btsocket_);
+VNET_DOMAIN_SET(ng_btsocket_);
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 95c6061..a5fcb14 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -789,6 +789,8 @@ ng_unref_node(node_p node)
if (node == &ng_deadnode)
return;
+ CURVNET_SET(node->nd_vnet);
+
if (refcount_release(&node->nd_refs)) { /* we were the last */
node->nd_type->refs--; /* XXX maybe should get types lock? */
@@ -807,6 +809,7 @@ ng_unref_node(node_p node)
mtx_destroy(&node->nd_input_queue.q_mtx);
NG_FREE_NODE(node);
}
+ CURVNET_RESTORE();
}
/************************************************************************
OpenPOWER on IntegriCloud