Bluetooth: Mesh: Fixes missing recv net_idx copy to context
Missing copy net_idx to ctx, this cause tx subnet not found
or different with rx subnet, when rx subnet net_idx not zero.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c
index 88e30a1..2cb663b 100644
--- a/subsys/bluetooth/mesh/subnet.c
+++ b/subsys/bluetooth/mesh/subnet.c
@@ -599,6 +599,7 @@
if (cb(rx, in, out, &bt_mesh.lpn.cred[j])) {
rx->new_key = (j > 0);
rx->friend_cred = 1U;
+ rx->ctx.net_idx = rx->sub->net_idx;
return true;
}
}
@@ -633,6 +634,7 @@
if (cb(rx, in, out, &frnd->cred[j])) {
rx->new_key = (j > 0);
rx->friend_cred = 1U;
+ rx->ctx.net_idx = rx->sub->net_idx;
return true;
}
}
@@ -653,6 +655,7 @@
if (cb(rx, in, out, &rx->sub->keys[j].msg)) {
rx->new_key = (j > 0);
rx->friend_cred = 0U;
+ rx->ctx.net_idx = rx->sub->net_idx;
return true;
}
}