Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions subsys/bluetooth/mesh/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
}

if (rx->net_if == BT_MESH_NET_IF_ADV &&
!rx->friend_cred &&
bt_mesh_relay_get() != BT_MESH_RELAY_ENABLED &&
bt_mesh_gatt_proxy_get() != BT_MESH_GATT_PROXY_ENABLED) {
return;
Expand All @@ -624,7 +625,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
* Anything else (like GATT to adv, or locally originated packets)
* use the Network Transmit state.
*/
if (rx->net_if == BT_MESH_NET_IF_ADV) {
if (rx->net_if == BT_MESH_NET_IF_ADV && !rx->friend_cred) {
transmit = bt_mesh_relay_retransmit_get();
} else {
transmit = bt_mesh_net_transmit_get();
Expand Down Expand Up @@ -661,18 +662,17 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
goto done;
}

/* Sending to the GATT bearer should only happen if GATT Proxy
* is enabled.
/* When the Friend node relays message for lpn, the message will be
* retransmitted using the managed master security credentials and
* the Network PDU shall be retransmitted to all network interfaces.
*/
if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY) &&
bt_mesh_gatt_proxy_get() == BT_MESH_GATT_PROXY_ENABLED) {
if (bt_mesh_proxy_relay(&buf->b, rx->ctx.recv_dst) &&
BT_MESH_ADDR_IS_UNICAST(rx->ctx.recv_dst)) {
goto done;
}
(rx->friend_cred ||
bt_mesh_gatt_proxy_get() == BT_MESH_GATT_PROXY_ENABLED)) {
bt_mesh_proxy_relay(&buf->b, rx->ctx.recv_dst);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless it breaks qualification, I think the old unicast address check should still be here. If a unicast message is going to a proxy node, there's no reason to relay it to the advertising bearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is suitable for white list, but if it is for black list, even unicast address does not mean it is required by proxy client.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking, if blacklist filtering is enabled, if the unicast address is not in the blacklist, does it mean that the proxy client needs this unicast address? In this case, it does not need to be relayed through ADV bearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I forgot the proxy puts the unicast addresses in the filters. I suppose we can only be sure of this check if the proxy is using a whitelist. Your original version was better, I didn't consider the blacklist.

}

if (relay_to_adv(rx->net_if)) {
if (relay_to_adv(rx->net_if) || rx->friend_cred) {
bt_mesh_adv_send(buf, NULL, NULL);
}

Expand Down