ble_mesh: Fixes wrong subnet info used for Friend Clear
When Friend node tries to send Friend Clear message to other Friend nodes, it should use the subnet information based on the net_idx from friendship.
This commit is contained in:
parent
131a4e7c22
commit
77e7d023b9
1 changed files with 2 additions and 2 deletions
|
@ -363,7 +363,7 @@ static int unseg_app_sdu_unpack(struct bt_mesh_friend *frnd,
|
||||||
meta->is_dev_key = (app_idx == BLE_MESH_KEY_DEV);
|
meta->is_dev_key = (app_idx == BLE_MESH_KEY_DEV);
|
||||||
bt_mesh_net_header_parse(&buf->b, &meta->net);
|
bt_mesh_net_header_parse(&buf->b, &meta->net);
|
||||||
err = bt_mesh_app_key_get(meta->subnet, app_idx, &meta->key,
|
err = bt_mesh_app_key_get(meta->subnet, app_idx, &meta->key,
|
||||||
&meta->aid, NODE, meta->net.ctx.addr);
|
&meta->aid, 0x0, meta->net.ctx.addr);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -774,7 +774,7 @@ static void send_friend_clear(struct bt_mesh_friend *frnd)
|
||||||
.send_ttl = BLE_MESH_TTL_MAX,
|
.send_ttl = BLE_MESH_TTL_MAX,
|
||||||
};
|
};
|
||||||
struct bt_mesh_net_tx tx = {
|
struct bt_mesh_net_tx tx = {
|
||||||
.sub = &bt_mesh.sub[0],
|
.sub = bt_mesh_subnet_get(frnd->net_idx),
|
||||||
.ctx = &ctx,
|
.ctx = &ctx,
|
||||||
.src = bt_mesh_primary_addr(),
|
.src = bt_mesh_primary_addr(),
|
||||||
.xmit = bt_mesh_net_transmit_get(),
|
.xmit = bt_mesh_net_transmit_get(),
|
||||||
|
|
Loading…
Reference in a new issue