Skip to content

Commit

Permalink
MAC: Moved MAC filters in data ind callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Apr 16, 2019
1 parent b961948 commit 30bce91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions source/MAC/IEEE802_15_4/mac_mcps_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,6 @@ static void mac_data_interface_frame_handler(mac_pre_parsed_frame_t *buf)
mcps_sap_pre_parsed_frame_buffer_free(buf);
return;
}

if (mac_filter_modify_link_quality(rf_mac_setup->mac_interface_id, buf) == 1) {
mcps_sap_pre_parsed_frame_buffer_free(buf);
return;
}
/* push data to stack if sniffer mode is enabled */
if (rf_mac_setup->macProminousMode) {
mac_nap_tun_data_handler(buf, rf_mac_setup);
Expand Down
3 changes: 3 additions & 0 deletions source/MAC/IEEE802_15_4/mac_pd_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,9 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message)
const uint8_t *ptr = mac_header_parse_fcf_dsn(&fcf_read, pd_data_ind->data_ptr);

mac_pre_parsed_frame_t *buffer = mac_pd_sap_allocate_receive_buffer(rf_ptr, fcf_read, pd_data_ind);
if (buffer && mac_filter_modify_link_quality(rf_ptr->mac_interface_id, buffer) == 1) {
goto ERROR_HANDLER;
}
if (!rf_ptr->macProminousMode) {
if (mac_pd_sap_validate_fcf(rf_ptr, fcf_read, pd_data_ind)) {
goto ERROR_HANDLER;
Expand Down
1 change: 1 addition & 0 deletions test/nanostack/unittest/mac/mac_pd_sap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TEST_SRC_FILES = \
../../stub/mac_mcps_sap_stub.c \
../../stub/mac_header_helper_functions_stub.c \
../../stub/mac_timer_stub.c \
../../stub/mac_filter_stub.c \
../../stub/protocol_core_stub.c \
../../stub/randLIB_stub.c \
../../stub/mac_mlme_stub.c \
Expand Down

0 comments on commit 30bce91

Please sign in to comment.