[PATCH BlueZ v1] shared/att: Fix failing to set security level

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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.
---
 src/shared/att.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/att.c b/src/shared/att.c
index 4a406f4b91a4..dabbdb4315eb 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -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;
-- 
2.47.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux