Bluetooth: att: Retry ATT request if security elevation is in progress
If the conn security elevation is already in progress, retry the ATT request if failed due to security reasons. Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
parent
f0715fcbb3
commit
f434198a2b
1 changed files with 5 additions and 1 deletions
|
@ -2519,9 +2519,13 @@ static uint8_t att_error_rsp(struct bt_att_chan *chan, struct net_buf *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = rsp->error;
|
err = rsp->error;
|
||||||
|
|
||||||
#if defined(CONFIG_BT_ATT_RETRY_ON_SEC_ERR)
|
#if defined(CONFIG_BT_ATT_RETRY_ON_SEC_ERR)
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Check if error can be handled by elevating security. */
|
/* Check if error can be handled by elevating security. */
|
||||||
if (!att_change_security(chan->chan.chan.conn, err)) {
|
ret = att_change_security(chan->chan.chan.conn, err);
|
||||||
|
if (ret == 0 || ret == -EBUSY) {
|
||||||
/* ATT timeout work is normally cancelled in att_handle_rsp.
|
/* ATT timeout work is normally cancelled in att_handle_rsp.
|
||||||
* However retrying is special case, so the timeout shall
|
* However retrying is special case, so the timeout shall
|
||||||
* be cancelled here.
|
* be cancelled here.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue