Commit ada5771d authored by Johan Hedberg's avatar Johan Hedberg Committed by Johan Hedberg
Browse files

Bluetooth: Mesh: Fix ignoring invalid Transport OpCode as LPN



MESH/NODE/FRND/LPN/BI-02-C requires us to ignore unknown Transport
OpCodes instead of treating them as valid responses to a Friend Poll.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent f5179733
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1267,8 +1267,12 @@ int bt_mesh_trans_recv(struct net_buf_simple *buf, struct bt_mesh_net_rx *rx)
	 * bt_mesh_lpn_waiting_update() function will return false:
	 * we still need to go through the actual sending to the bearer and
	 * wait for ReceiveDelay before transitioning to WAIT_UPDATE state.
	 *
	 * ENOENT is a special condition that's only used to indicate that
	 * the Transport OpCode was invalid, in which case we should ignore
	 * the PDU completely, as per MESH/NODE/FRND/LPN/BI-02-C.
	 */
	if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER) &&
	if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER) && err != -ENOENT &&
	    bt_mesh_lpn_established() && bt_mesh_lpn_waiting_update()) {
		bt_mesh_lpn_msg_received(rx);
	}