Skip to contentSkip to conversation

Bluetooth: make L2CAP sockets to inherit parent's priority

PATCH In review Luiz Augusto von Dentz 2 participants 4 messages Nov 4, 2011 – Nov 15, 2011

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: make L2CAP sockets to inherit parent's priority

From: Luiz Augusto von Dentz <[email protected]>

This makes priority set on a listen socket to be passed when accepting new connections.

---
 net/bluetooth/l2cap_sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/l2cap_sock.c +1 -0
index 664762e..5a5d2c6 100644
@@ -968,6 +968,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
 		struct l2cap_chan *pchan = l2cap_pi(parent)->chan;
 
 		sk->sk_type = parent->sk_type;
+		sk->sk_priority = parent->sk_priority;
 		bt_sk(sk)->defer_setup = bt_sk(parent)->defer_setup;
 
 		chan->chan_type = pchan->chan_type;
Signature · 1 line
1.7.6.4
author maintainer
#1 lore raw

PATCH 2/2 Bluetooth: make RFCOMM sockets to inherit parent's priority

From: Luiz Augusto von Dentz <[email protected]>

This makes priority set on a listen socket to be passed when accepting new connections.

---
 net/bluetooth/rfcomm/sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/rfcomm/sock.c +1 -0
index 40988e2..81d658d 100644
@@ -260,6 +260,7 @@ static void rfcomm_sock_init(struct sock *sk, struct sock *parent)
 
 	if (parent) {
 		sk->sk_type = parent->sk_type;
+		sk->sk_priority = parent->sk_priority;
 		pi->dlc->defer_setup = bt_sk(parent)->defer_setup;
 
 		pi->sec_level = rfcomm_pi(parent)->sec_level;
Signature · 1 line
1.7.6.4
author maintainer
#3 lore raw

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

Hi Luiz,

Quoted 4 lines

From: Luiz Augusto von Dentz <[email protected]>

This makes priority set on a listen socket to be passed when accepting new connections.

I am in general fine with this, but is this the expected behavior of SO_PRIORITY from other socket types?

Apparently it is not inherited in other socket types, so I guess we should not inherit. In this case I will fix l2test/rctest to use setsockopt on accepted sockets, similar to what is done with SO_LINGER.

Signature · 1 line
Luiz Augusto von Dentz