Skip to content

Commit 631703d

Browse files
committed
[nrf fromlist] bluetooth: mesh: lpn shouldn't relay messages received over friendship
Commit fixes the issue when lpn device relays broad- and group cast messages received over friendship queue. This is specification violation, see Table 3.13: Network layer Network PDU retransmission requirements. Also, it does not have sense since sending messages have already happened and lpn just consumes extra power to retransmit useless data. In general, lpn device will be more power efficient after this fix. Upstream PR #: 100285 Signed-off-by: Aleksandr Khromykh <[email protected]> (cherry picked from commit b502dec131912d546de6e0e570bcb1aaf7c001e9)
1 parent fc695cb commit 631703d

File tree

1 file changed

+6
-3
lines changed
  • subsys/bluetooth/mesh

1 file changed

+6
-3
lines changed

subsys/bluetooth/mesh/net.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,13 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi,
924924
}
925925

926926
/* Relay if this was a group/virtual address, or if the destination
927-
* was neither a local element nor an LPN we're Friends for.
927+
* was neither a local element nor an LPN we're Friends for, and
928+
* device is not in Friendship as the Low Power node or the message is not encrypted using
929+
* friendship security credentials.
928930
*/
929-
if (!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
930-
(!rx.local_match && !rx.friend_match)) {
931+
if ((!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
932+
(!rx.local_match && !rx.friend_match)) &&
933+
(!bt_mesh_lpn_established() || !rx.friend_cred)) {
931934
net_buf_simple_restore(&buf, &state);
932935
bt_mesh_net_relay(&buf, &rx, false);
933936
}

0 commit comments

Comments
 (0)