Bluetooth: Mesh: Fix ignoring all messages in LPN mode

Even though we have LPN enabled, we might still receive messages
through other network interfaces than the advertising one (e.g. the
local network interface).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-18 12:04:25 +02:00 committed by Johan Hedberg
commit a5340e72a3

View file

@ -1278,7 +1278,7 @@ int bt_mesh_trans_recv(struct net_buf_simple *buf, struct bt_mesh_net_rx *rx)
* be encrypted using the Friend Credentials.
*/
if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER) &&
bt_mesh_lpn_established() &&
bt_mesh_lpn_established() && rx->net_if == BT_MESH_NET_IF_ADV &&
(!bt_mesh_lpn_waiting_update() || !rx->friend_cred)) {
BT_WARN("Ignoring unexpected message in Low Power mode");
return -EAGAIN;