From a9a18cec7b34daa99edd83eec43aaeecfbcfde7a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 27 Nov 2017 21:02:38 +0200 Subject: [PATCH] Bluetooth: Mesh: Fix clearing Friend state upon reset Not clearing the Friend state could risk invalid timers staying active, etc. Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/mesh/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subsys/bluetooth/host/mesh/main.c b/subsys/bluetooth/host/mesh/main.c index 69fc1ea5f3f..092d3408918 100644 --- a/subsys/bluetooth/host/mesh/main.c +++ b/subsys/bluetooth/host/mesh/main.c @@ -120,6 +120,10 @@ void bt_mesh_reset(void) bt_mesh_lpn_disable(true); } + if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) { + bt_mesh_friend_clear_net_idx(BT_MESH_KEY_ANY); + } + if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) { bt_mesh_proxy_gatt_disable(); }