Skip to content

Commit

Permalink
Wi-sun neighbor temporary neigh update
Browse files Browse the repository at this point in the history
Keep neigh min 120 seconds in all case before remove from the list. 120 seconds must be from last RX packet.

Change-Id: Ife14e4606d3c49073fd0590513f266f37a1237b6
  • Loading branch information
Juha Heiskanen committed Sep 3, 2019
1 parent 05fa359 commit 313794c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
11 changes: 1 addition & 10 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,19 +1368,10 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
}
}

uint32_t link_min_timeout;
//Read current timestamp
uint32_t time_from_last_unicast_shedule = ws_time_from_last_unicast_traffic(current_time_stamp, ws_neighbor);


if (cur->trusted_device) {
link_min_timeout = WS_NEIGHBOR_TRUSTED_LINK_MIN_TIMEOUT;
} else {

link_min_timeout = WS_NEIGHBOR_NOT_TRUSTED_LINK_MIN_TIMEOUT;
}

if (time_from_last_unicast_shedule > link_min_timeout || !ws_neighbor->unicast_data_rx) {
if (time_from_last_unicast_shedule > WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT || !ws_neighbor->unicast_data_rx) {
//Accept only Enough Old Device
if (!neighbor_entry_ptr) {
//Accept first compare
Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/ws/ws_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ bool ws_common_negative_aro_mark(protocol_interface_info_entry_t *interface, con
}
ws_neighbor_class_entry_t *ws_neighbor = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, neighbour->index);
ws_neighbor->negative_aro_send = true;
neighbour->lifetime = WS_NEIGHBOR_NOT_TRUSTED_LINK_MIN_TIMEOUT; //Remove anyway if Packet is freed before MAC push
neighbour->lifetime = WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT; //Remove anyway if Packet is freed before MAC push
return true;
}

Expand Down
3 changes: 1 addition & 2 deletions source/6LoWPAN/ws/ws_common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ typedef struct ws_bs_ie {
#define WS_FAN_VERSION_1_0 1

#define WS_NEIGHBOR_LINK_TIMEOUT 2200
#define WS_NEIGHBOR_NOT_TRUSTED_LINK_MIN_TIMEOUT 60
#define WS_NEIGHBOR_TRUSTED_LINK_MIN_TIMEOUT 15
#define WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT 120
#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2

#define WS_NEIGBOR_ETX_SAMPLE_MAX 3
Expand Down

0 comments on commit 313794c

Please sign in to comment.