Skip to content

Commit aaf2b39

Browse files
author
Juha Heiskanen
committed
Wi-sun dublicate MPX ID filter support
LLC layer will drop id it hear same ID again in 5sec period. Change-Id: Idc86736d95b8298318144aebf61f77383ee85b2f
1 parent bd51f9f commit aaf2b39

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

source/6LoWPAN/ws/ws_llc_data_service.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
526526
tr_debug("Drop message no neighbor");
527527
return;
528528
}
529+
//Storage Time from Last Unicast rx time stamp
530+
uint32_t time_from_last = data->timestamp - neighbor_info.ws_neighbor->fhss_data.uc_timing_info.utt_rx_timestamp;
529531

530532
ws_neighbor_class_neighbor_unicast_time_info_update(neighbor_info.ws_neighbor, &ws_utt, data->timestamp);
531533
if (us_ie_inline) {
@@ -570,6 +572,19 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
570572
}
571573
}
572574

575+
//MPX Duplicate Address Detection
576+
if (neighbor_info.ws_neighbor->mpx_stored) {
577+
578+
if (time_from_last < 5000000 && neighbor_info.ws_neighbor->mpx_id == mpx_frame.transaction_id) {
579+
tr_debug("Drop message: Dublicate mpx id in short time");
580+
return;
581+
}
582+
} else {
583+
neighbor_info.ws_neighbor->mpx_stored = true;
584+
}
585+
//Store MPX
586+
neighbor_info.ws_neighbor->mpx_id = mpx_frame.transaction_id;
587+
573588
// Discover MPX
574589
mpx_user_t *user_cb = ws_llc_mpx_user_discover(&base->mpx_data_base, mpx_frame.multiplex_id);
575590
if (user_cb && user_cb->data_ind) {

source/6LoWPAN/ws/ws_neighbor_class.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ typedef struct ws_neighbor_class_entry {
2828
uint16_t rsl_in; /*!< RSL EWMA heard from neighbour*/
2929
uint16_t rsl_out; /*!< RSL EWMA heard by neighbour*/
3030
uint16_t routing_cost; /*!< ETX to border Router. */
31+
unsigned mpx_id: 5;
32+
bool mpx_stored: 1;
3133
bool candidate_parent: 1;
3234
bool broadcast_timing_info_stored: 1;
3335
bool broadcast_shedule_info_stored: 1;

0 commit comments

Comments
 (0)