Skip to content

Commit 6c25cf5

Browse files
Juha HeiskanenJarkko Paso
authored andcommitted
Dynamic min lifetime for temporary neighbour.
Change-Id: I85308f464ce3513406b637063c9f41ad5d461855
1 parent 0b7c87a commit 6c25cf5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,13 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
14971497

14981498
//Read current timestamp
14991499
uint32_t time_from_last_unicast_shedule = ws_time_from_last_unicast_traffic(current_time_stamp, ws_neighbor);
1500-
1501-
if (time_from_last_unicast_shedule > WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT) {
1500+
uint32_t min_timeout;
1501+
if (interface->ws_info->network_size_config == NETWORK_SIZE_LARGE) {
1502+
min_timeout = WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_LARGE;
1503+
} else {
1504+
min_timeout = WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_SMALL;
1505+
}
1506+
if (time_from_last_unicast_shedule > min_timeout) {
15021507
//Accept only Enough Old Device
15031508
if (!neighbor_entry_ptr) {
15041509
//Accept first compare

source/6LoWPAN/ws/ws_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ bool ws_common_negative_aro_mark(protocol_interface_info_entry_t *interface, con
438438
}
439439
ws_neighbor_class_entry_t *ws_neighbor = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, neighbour->index);
440440
ws_neighbor->negative_aro_send = true;
441-
neighbour->lifetime = WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT; //Remove anyway if Packet is freed before MAC push
441+
neighbour->lifetime = WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_SMALL; //Remove anyway if Packet is freed before MAC push
442442
return true;
443443
}
444444

source/6LoWPAN/ws/ws_common_defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ typedef struct ws_bs_ie {
186186
#define WS_FAN_VERSION_1_0 1
187187

188188
#define WS_NEIGHBOR_LINK_TIMEOUT 2200
189-
#define WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT 120
189+
#define WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_LARGE 520
190+
#define WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_SMALL 260
190191
#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2
191192

192193
#define WS_NEIGBOR_ETX_SAMPLE_MAX 3

0 commit comments

Comments
 (0)