diff options
author | Mikolaj Golub <trociny@FreeBSD.org> | 2014-06-10 18:21:37 +0000 |
---|---|---|
committer | Mikolaj Golub <trociny@FreeBSD.org> | 2014-06-10 18:21:37 +0000 |
commit | 4a8e4eb55b182098293a2243a0a9e2a6fb4de433 (patch) | |
tree | 98d8fbc1d1a4eae89b4e7b9e06abfff6f388ee8c /sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | |
parent | 6fd4061119cfa5d6a678e17fa79075c81ddb78c6 (diff) |
PF_BLUETOOTH protocols: skip initialization of non-virtualized globals
for non-default VNET instances.
This fixes panic on a vnet initialization when ng_btsocket is loaded.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=267336
Diffstat (limited to 'sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c')
-rw-r--r-- | sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index 35cd766d2ebe..4c71414c88a7 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -51,6 +51,9 @@ #include <sys/socketvar.h> #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> @@ -728,6 +731,10 @@ ng_btsocket_hci_raw_init(void) bitstr_t *f = NULL; int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_hci_raw_node = NULL; ng_btsocket_hci_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_hci_raw_ioctl_timeout = 5; |