Bluetooth: Mesh: Cfg: Only update friend state if supported

If Friend support is not available we should not modify the value of
cfg->frnd.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-10-30 15:00:04 +02:00 committed by Johan Hedberg
commit a6ce33d7ea

View file

@ -2473,7 +2473,9 @@ static void friend_set(struct bt_mesh_model *model,
goto send_status;
}
cfg->frnd = buf->data[0];
if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
cfg->frnd = buf->data[0];
}
sub = bt_mesh_subnet_get(cfg->hb_pub.net_idx);
if ((cfg->hb_pub.feat & BT_MESH_FEAT_FRIEND) && sub) {