Date: Mon, 30 Jun 2014 19:47:26 +0000 (UTC) From: Mikolaj Golub <trociny@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268062 - stable/9/sys/netgraph/bluetooth/socket Message-ID: <201406301947.s5UJlQku082103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trociny Date: Mon Jun 30 19:47:26 2014 New Revision: 268062 URL: http://svnweb.freebsd.org/changeset/base/268062 Log: MFC r267336: 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. Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Mon Jun 30 19:46:17 2014 (r268061) +++ stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Mon Jun 30 19:47:26 2014 (r268062) @@ -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; Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Mon Jun 30 19:46:17 2014 (r268061) +++ stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Mon Jun 30 19:47:26 2014 (r268062) @@ -1813,6 +1813,10 @@ ng_btsocket_l2cap_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_node = NULL; ng_btsocket_l2cap_debug_level = NG_BTSOCKET_WARN_LEVEL; Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Mon Jun 30 19:46:17 2014 (r268061) +++ stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Mon Jun 30 19:47:26 2014 (r268062) @@ -50,6 +50,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> @@ -513,6 +516,10 @@ ng_btsocket_l2cap_raw_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_raw_node = NULL; ng_btsocket_l2cap_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_l2cap_raw_ioctl_timeout = 5; Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 30 19:46:17 2014 (r268061) +++ stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 30 19:47:26 2014 (r268062) @@ -328,6 +328,11 @@ ng_btsocket_rfcomm_check_fcs(u_int8_t *d void ng_btsocket_rfcomm_init(void) { + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_rfcomm_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_rfcomm_timo = 60; Modified: stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Mon Jun 30 19:46:17 2014 (r268061) +++ stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Mon Jun 30 19:47:26 2014 (r268062) @@ -1107,6 +1107,10 @@ ng_btsocket_sco_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_sco_node = NULL; ng_btsocket_sco_debug_level = NG_BTSOCKET_WARN_LEVEL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406301947.s5UJlQku082103>