From 0af9c0f8e3679dd24172046a43d55dde0908aef8 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 1 Dec 2025 09:28:21 +0100 Subject: [PATCH] [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 (cherry picked from commit b502dec131912d546de6e0e570bcb1aaf7c001e9) (cherry picked from commit 66cda9da197b27272cd50fbdb788620c70b05bd5) --- subsys/bluetooth/mesh/net.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index d791ba46f9ab..f85f3e7a050c 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -924,10 +924,13 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi, } /* Relay if this was a group/virtual address, or if the destination - * was neither a local element nor an LPN we're Friends for. + * was neither a local element nor an LPN we're Friends for, and + * device is not in Friendship as the Low Power node or the message is not encrypted using + * friendship security credentials. */ - if (!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || - (!rx.local_match && !rx.friend_match)) { + if ((!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || + (!rx.local_match && !rx.friend_match)) && + (!bt_mesh_lpn_established() || !rx.friend_cred)) { net_buf_simple_restore(&buf, &state); bt_mesh_net_relay(&buf, &rx, false); }