Skip to content

Commit 3e23053

Browse files
Johan HedbergAnas Nashif
authored andcommitted
Bluetooth: Mesh: Fix Set LPNTimeout message handling
We should ignore invalid addresses (helps pass MESH/NODE/CFG/LPNPT/BI-01-C). Also fix a copy-paste issue in an error log. Signed-off-by: Johan Hedberg <[email protected]>
1 parent a23d390 commit 3e23053

File tree

1 file changed

+6
-1
lines changed
  • subsys/bluetooth/host/mesh

1 file changed

+6
-1
lines changed

subsys/bluetooth/host/mesh/cfg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2489,12 +2489,17 @@ static void lpn_timeout_get(struct bt_mesh_model *model,
24892489
BT_DBG("net_idx 0x%04x app_idx 0x%04x src 0x%04x lpn_addr 0x%02x",
24902490
ctx->net_idx, ctx->app_idx, ctx->addr, lpn_addr);
24912491

2492+
if (!BT_MESH_ADDR_IS_UNICAST(lpn_addr)) {
2493+
BT_WARN("Invalid LPNAddress; ignoring msg");
2494+
return;
2495+
}
2496+
24922497
bt_mesh_model_msg_init(msg, OP_LPN_TIMEOUT_STATUS);
24932498
net_buf_simple_add_le16(msg, lpn_addr);
24942499
memset(net_buf_simple_add(msg, 3), 0, 3);
24952500

24962501
if (bt_mesh_model_send(model, ctx, msg, NULL, NULL)) {
2497-
BT_ERR("Unable to send Friend Status");
2502+
BT_ERR("Unable to send LPN PollTimeout Status");
24982503
}
24992504
}
25002505

0 commit comments

Comments
 (0)