mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
feat(ble_mesh): Miscellaneous updates for mesh kconfig, relay related
This commit is contained in:
@ -623,6 +623,21 @@ if BLE_MESH
|
|||||||
number of each node should also be taken into consideration. For example, if
|
number of each node should also be taken into consideration. For example, if
|
||||||
Provisioner can provision up to 20 nodes and each node contains two elements,
|
Provisioner can provision up to 20 nodes and each node contains two elements,
|
||||||
then the replay protection list size of Provisioner should be at least 40.
|
then the replay protection list size of Provisioner should be at least 40.
|
||||||
|
|
||||||
|
config BLE_MESH_NOT_RELAY_REPLAY_MSG
|
||||||
|
bool "Not relay replayed messages in a mesh network"
|
||||||
|
depends on BLE_MESH_EXPERIMENTAL
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
There may be many expired messages in a complex mesh network that would be
|
||||||
|
considered replayed messages.
|
||||||
|
Enable this option will refuse to relay such messages, which could help to
|
||||||
|
reduce invalid packets in the mesh network.
|
||||||
|
However, it should be noted that enabling this option may result in packet
|
||||||
|
loss in certain environments.
|
||||||
|
Therefore, users need to decide whether to enable this option according to
|
||||||
|
the actual usage situation.
|
||||||
|
|
||||||
|
|
||||||
config BLE_MESH_MSG_CACHE_SIZE
|
config BLE_MESH_MSG_CACHE_SIZE
|
||||||
int "Network message cache size"
|
int "Network message cache size"
|
||||||
@ -1451,7 +1466,7 @@ if BLE_MESH
|
|||||||
|
|
||||||
config BLE_MESH_MBT_CLI
|
config BLE_MESH_MBT_CLI
|
||||||
bool "BLOB Transfer Client model"
|
bool "BLOB Transfer Client model"
|
||||||
default y
|
default n
|
||||||
help
|
help
|
||||||
Enable support for BLOB Transfer Client model.
|
Enable support for BLOB Transfer Client model.
|
||||||
|
|
||||||
@ -1469,7 +1484,7 @@ if BLE_MESH
|
|||||||
|
|
||||||
config BLE_MESH_MBT_SRV
|
config BLE_MESH_MBT_SRV
|
||||||
bool "BLOB Transfer Server model"
|
bool "BLOB Transfer Server model"
|
||||||
default y
|
default n
|
||||||
help
|
help
|
||||||
Enable support for BLOB Transfer Server model.
|
Enable support for BLOB Transfer Server model.
|
||||||
|
|
||||||
@ -1607,4 +1622,12 @@ if BLE_MESH
|
|||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
config BLE_MESH_EXPERIMENTAL
|
||||||
|
bool "Make BLE Mesh experimental features visible"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Make BLE Mesh Experimental features visible.
|
||||||
|
Experimental features list:
|
||||||
|
- CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
|
||||||
|
|
||||||
endif # BLE_MESH
|
endif # BLE_MESH
|
||||||
|
@ -1542,7 +1542,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
BT_ERR("Out of relay buffers");
|
BT_INFO("Out of relay buffers");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1855,7 +1855,11 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi,
|
|||||||
* was neither a local element nor an LPN we're Friends for.
|
* was neither a local element nor an LPN we're Friends for.
|
||||||
*/
|
*/
|
||||||
if (!BLE_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
|
if (!BLE_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
|
||||||
(!rx.local_match && !rx.friend_match)) {
|
(!rx.local_match && !rx.friend_match
|
||||||
|
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
|
||||||
|
&& !rx.replay_msg
|
||||||
|
#endif
|
||||||
|
)) {
|
||||||
net_buf_simple_restore(&buf, &state);
|
net_buf_simple_restore(&buf, &state);
|
||||||
bt_mesh_net_relay(&buf, &rx);
|
bt_mesh_net_relay(&buf, &rx);
|
||||||
}
|
}
|
||||||
|
@ -391,6 +391,9 @@ struct bt_mesh_net_rx {
|
|||||||
net_if:2, /* Network interface */
|
net_if:2, /* Network interface */
|
||||||
local_match:1, /* Matched a local element */
|
local_match:1, /* Matched a local element */
|
||||||
friend_match:1, /* Matched an LPN we're friends for */
|
friend_match:1, /* Matched an LPN we're friends for */
|
||||||
|
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
|
||||||
|
replay_msg:1, /* Replayed messages */
|
||||||
|
#endif
|
||||||
sbr_rpl:1; /* Bridge RPL attacker */
|
sbr_rpl:1; /* Bridge RPL attacker */
|
||||||
uint16_t msg_cache_idx; /* Index of entry in message cache */
|
uint16_t msg_cache_idx; /* Index of entry in message cache */
|
||||||
};
|
};
|
||||||
|
@ -64,6 +64,10 @@ static bool rpl_check_and_store(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
|
||||||
|
rx->replay_msg = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user