summaryrefslogtreecommitdiff
path: root/sys/netgraph
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2011-02-16 21:29:13 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2011-02-16 21:29:13 +0000
commit1fb51a12f24a4d5ffd7d105589ed8e002ad67320 (patch)
treee312f60d853b2306ae67fe2988280d1dbc41c9cf /sys/netgraph
parent55a8000cd732746b04e6d31ea1250cf5df13c99c (diff)
Notes
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c8
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c8
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_sco.c8
3 files changed, 21 insertions, 3 deletions
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
index 0ac24e54961a..efca538993c4 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
@@ -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>
@@ -592,8 +595,11 @@ ng_btsocket_l2cap_process_l2ca_con_ind(struct ng_mesg *msg,
* space then create new socket and set proper source address.
*/
- if (pcb->so->so_qlen <= pcb->so->so_qlimit)
+ if (pcb->so->so_qlen <= pcb->so->so_qlimit) {
+ CURVNET_SET(pcb->so->so_vnet);
so1 = sonewconn(pcb->so, 0);
+ CURVNET_RESTORE();
+ }
if (so1 == NULL) {
result = NG_L2CAP_NO_RESOURCES;
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
index 1fd9eb3b83dc..f07da3a5527e 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
@@ -52,6 +52,9 @@
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/uio.h>
+
+#include <net/vnet.h>
+
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/bluetooth/include/ng_bluetooth.h>
@@ -1163,8 +1166,11 @@ ng_btsocket_rfcomm_connect_ind(ng_btsocket_rfcomm_session_p s, int channel)
mtx_lock(&pcb->pcb_mtx);
- if (pcb->so->so_qlen <= pcb->so->so_qlimit)
+ if (pcb->so->so_qlen <= pcb->so->so_qlimit) {
+ CURVNET_SET(pcb->so->so_vnet);
so1 = sonewconn(pcb->so, 0);
+ CURVNET_RESTORE();
+ }
mtx_unlock(&pcb->pcb_mtx);
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
index e1bff5767083..85b68dcb3f6f 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
@@ -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>
@@ -477,8 +480,11 @@ ng_btsocket_sco_process_lp_con_ind(struct ng_mesg *msg,
* space then create new socket and set proper source address.
*/
- if (pcb->so->so_qlen <= pcb->so->so_qlimit)
+ if (pcb->so->so_qlen <= pcb->so->so_qlimit) {
+ CURVNET_SET(pcb->so->so_vnet);
so1 = sonewconn(pcb->so, 0);
+ CURVNET_RESTORE();
+ }
if (so1 == NULL) {
status = 0x0d; /* Rejected due to limited resources */