Skip to content

Commit

Permalink
FHSS: prevent unicast on broadcast channel in tx handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Oct 8, 2018
1 parent f17e6cd commit 5ddf5fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,13 @@ static int fhss_ws_tx_handle_callback(const fhss_api_t *api, bool is_broadcast_a
if (!fhss_structure) {
return -1;
}
if (is_broadcast_addr || (fhss_structure->ws->is_on_bc_channel == true)) {
if (is_broadcast_addr) {
return 0;
}
// Do not allow unicast destination on broadcast channel
if (!is_broadcast_addr && (fhss_structure->ws->is_on_bc_channel == true)) {
return -1;
}
// Check TX/RX slot
if (!fhss_ws_check_tx_allowed(fhss_structure)) {
return -1;
Expand Down

0 comments on commit 5ddf5fa

Please sign in to comment.