提交 e0c888ad 编写于 作者: J Johan Hedberg

Bluetooth: Fix BT_SECURITY socket option for fixed channels (ATT)

The BT_SECURITY option should also be allowed for fixed channels, so
punch the appropriate hole for it when checking for the channel type.
The main user of fixed CID user space sockets is right now ATT (which is
broken without this patch).
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 21626e62
...@@ -513,6 +513,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ...@@ -513,6 +513,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname,
switch (optname) { switch (optname) {
case BT_SECURITY: case BT_SECURITY:
if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED && if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED &&
chan->chan_type != L2CAP_CHAN_FIXED &&
chan->chan_type != L2CAP_CHAN_RAW) { chan->chan_type != L2CAP_CHAN_RAW) {
err = -EINVAL; err = -EINVAL;
break; break;
...@@ -769,6 +770,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -769,6 +770,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
switch (optname) { switch (optname) {
case BT_SECURITY: case BT_SECURITY:
if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED && if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED &&
chan->chan_type != L2CAP_CHAN_FIXED &&
chan->chan_type != L2CAP_CHAN_RAW) { chan->chan_type != L2CAP_CHAN_RAW) {
err = -EINVAL; err = -EINVAL;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册