mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Bluetooth: Require streaming mode when it is requested for a socket
The L2CAP specification has two ways to support streaming mode: Allow fallback to ERTM or basic mode when the remote device requests one of those modes, or make the connection fail unless both sides agree on streaming mode. The current code does not properly support either method. This change makes a streaming mode connection fail if the remote device does not also request streaming mode. CRs-fixed: 336291 Change-Id: Id26f963a5e15d18e85a2faf2f8f01848e2a73fa4 Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This commit is contained in:
parent
08168d3622
commit
ee9ccbb803
1 changed files with 9 additions and 1 deletions
|
@ -611,8 +611,16 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
|
|||
case L2CAP_MODE_BASIC:
|
||||
l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_STATE2_DEVICE;
|
||||
break;
|
||||
case L2CAP_MODE_ERTM:
|
||||
case L2CAP_MODE_STREAMING:
|
||||
if (!disable_ertm) {
|
||||
/* No fallback to ERTM or Basic mode */
|
||||
l2cap_pi(sk)->conf_state |=
|
||||
L2CAP_CONF_STATE2_DEVICE;
|
||||
break;
|
||||
}
|
||||
err = -EINVAL;
|
||||
break;
|
||||
case L2CAP_MODE_ERTM:
|
||||
if (!disable_ertm)
|
||||
break;
|
||||
/* fall through */
|
||||
|
|
Loading…
Reference in a new issue