Bluetooth: Mesh: Fix ignoring all prohibited sub_dst in HB Sub Set

Section 4.2.18.2 in the Mesh Profile Specification states:

"The Heartbeat Subscription Destination shall be the unassigned address,
the primary unicast address of the node, or a group address, all other
values are Prohibited."

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-02 15:20:07 +02:00 committed by Johan Hedberg
commit ebf1a3c661

View file

@ -2820,7 +2820,9 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
return;
}
if (BT_MESH_ADDR_IS_VIRTUAL(sub_dst)) {
if (BT_MESH_ADDR_IS_VIRTUAL(sub_dst) || BT_MESH_ADDR_IS_RFU(sub_dst) ||
(BT_MESH_ADDR_IS_UNICAST(sub_dst) &&
sub_dst != bt_mesh_primary_addr())) {
BT_WARN("Prohibited destination address");
return;
}