Skip to content

Commit 30bce91

Browse files
author
Jarkko Paso
committed
MAC: Moved MAC filters in data ind callback
1 parent b961948 commit 30bce91

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,6 @@ static void mac_data_interface_frame_handler(mac_pre_parsed_frame_t *buf)
980980
mcps_sap_pre_parsed_frame_buffer_free(buf);
981981
return;
982982
}
983-
984-
if (mac_filter_modify_link_quality(rf_mac_setup->mac_interface_id, buf) == 1) {
985-
mcps_sap_pre_parsed_frame_buffer_free(buf);
986-
return;
987-
}
988983
/* push data to stack if sniffer mode is enabled */
989984
if (rf_mac_setup->macProminousMode) {
990985
mac_nap_tun_data_handler(buf, rf_mac_setup);

source/MAC/IEEE802_15_4/mac_pd_sap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,9 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message)
786786
const uint8_t *ptr = mac_header_parse_fcf_dsn(&fcf_read, pd_data_ind->data_ptr);
787787

788788
mac_pre_parsed_frame_t *buffer = mac_pd_sap_allocate_receive_buffer(rf_ptr, fcf_read, pd_data_ind);
789+
if (buffer && mac_filter_modify_link_quality(rf_ptr->mac_interface_id, buffer) == 1) {
790+
goto ERROR_HANDLER;
791+
}
789792
if (!rf_ptr->macProminousMode) {
790793
if (mac_pd_sap_validate_fcf(rf_ptr, fcf_read, pd_data_ind)) {
791794
goto ERROR_HANDLER;

test/nanostack/unittest/mac/mac_pd_sap/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TEST_SRC_FILES = \
1919
../../stub/mac_mcps_sap_stub.c \
2020
../../stub/mac_header_helper_functions_stub.c \
2121
../../stub/mac_timer_stub.c \
22+
../../stub/mac_filter_stub.c \
2223
../../stub/protocol_core_stub.c \
2324
../../stub/randLIB_stub.c \
2425
../../stub/mac_mlme_stub.c \

0 commit comments

Comments
 (0)