mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-30 07:34:27 +08:00
shared/att: Fix failing to set security level
bt_att_chan_set_security attempts to set BT_SECURITY without first checking what is the current security level which may cause errors since the kernel does actually return -EINVAL when the security doesn't change.
This commit is contained in:
parent
da0253959e
commit
5c65356cae
@ -727,6 +727,9 @@ static bool bt_att_chan_set_security(struct bt_att_chan *chan, int level)
|
||||
{
|
||||
struct bt_security sec;
|
||||
|
||||
if (level == bt_att_chan_get_security(chan))
|
||||
return true;
|
||||
|
||||
if (chan->type == BT_ATT_LOCAL) {
|
||||
chan->sec_level = level;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user