Bluetooth: Mesh: Fix clearing network message cache

Since the stack supports runtime reset and reprovisioning, we need to
clear the network message cache whenever creating a new mesh network.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-27 14:32:59 +02:00 committed by Johan Hedberg
commit 46f8c7fb44

View file

@ -445,6 +445,9 @@ int bt_mesh_net_create(u16_t idx, u8_t flags, const u8_t key[16],
return -EALREADY;
}
memset(msg_cache, 0, sizeof(msg_cache));
msg_cache_next = 0;
sub = &bt_mesh.sub[0];
sub->kr_flag = BT_MESH_KEY_REFRESH(flags);