From 9e8b78b8e1bcc70e213670a17469b6af44ed1fe4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 26 Feb 2020 14:03:59 -0800 Subject: [PATCH] Bluetooth: GATT: Fix not clearing CF_OUT_OF_SYNC If the client is change-unware and disconnects the spec requires that the stack still sends the error out of sync for the next request: 'The ATT_ERROR_RSP PDU 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 ATT_ERROR_RSP PDU shall be sent again' Fixes #23110 Signed-off-by: Luiz Augusto von Dentz --- subsys/bluetooth/host/gatt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 9b0e2049f15..432f2e219cf 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -713,6 +713,7 @@ static void remove_cf_cfg(struct bt_conn *conn) } else { /* Update address in case it has changed */ bt_addr_le_copy(&cfg->peer, &conn->le.dst); + atomic_clear_bit(cfg->flags, CF_OUT_OF_SYNC); } } #endif /* CONFIG_BT_GATT_CACHING */