From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 18:21:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46548F70; Tue, 10 Jun 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33271235C; Tue, 10 Jun 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AILdaW044069; Tue, 10 Jun 2014 18:21:39 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AILcxp044064; Tue, 10 Jun 2014 18:21:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201406101821.s5AILcxp044064@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Jun 2014 18:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267336 - head/sys/netgraph/bluetooth/socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 18:21:39 -0000 Author: trociny Date: Tue Jun 10 18:21:37 2014 New Revision: 267336 URL: http://svnweb.freebsd.org/changeset/base/267336 Log: 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 Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Tue Jun 10 18:21:37 2014 (r267336) @@ -51,6 +51,9 @@ #include #include #include + +#include + #include #include #include @@ -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: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 18:21:37 2014 (r267336) @@ -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: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 18:21:37 2014 (r267336) @@ -50,6 +50,9 @@ #include #include #include + +#include + #include #include #include @@ -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: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 18:21:37 2014 (r267336) @@ -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: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Tue Jun 10 18:21:37 2014 (r267336) @@ -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;