Bluetooth: GATT: Fix not clearing out of sync flag
When the database changes and a client becomes change unware it should also clear the out of sync flag as the following request should return an error: Core Spec 5.1 | Vol 3, Part G, 2.5.2.1 Robust Caching: 'The error response is sent only once after the client becomes change-unaware, unless the client disconnects or the database changes again before the client becomes change-aware in which case the error response shall be sent again.' Fixes: #18183 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
67a2ae53ae
commit
692d7d523e
1 changed files with 12 additions and 3 deletions
|
@ -824,9 +824,18 @@ static void db_changed(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CF_ROBUST_CACHING(cfg) &&
|
if (CF_ROBUST_CACHING(cfg)) {
|
||||||
atomic_test_and_clear_bit(cfg->flags, CF_CHANGE_AWARE)) {
|
/* Core Spec 5.1 | Vol 3, Part G, 2.5.2.1 Robust Caching
|
||||||
BT_DBG("%s change-unaware", bt_addr_le_str(&cfg->peer));
|
*... the database changes again before the client
|
||||||
|
* becomes change-aware in which case the error response
|
||||||
|
* shall be sent again.
|
||||||
|
*/
|
||||||
|
atomic_clear_bit(cfg->flags, CF_OUT_OF_SYNC);
|
||||||
|
if (atomic_test_and_clear_bit(cfg->flags,
|
||||||
|
CF_CHANGE_AWARE)) {
|
||||||
|
BT_DBG("%s change-unaware",
|
||||||
|
bt_addr_le_str(&cfg->peer));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue