Skip to content

Commit f37dcf2

Browse files
author
Juha Heiskanen
committed
Wi-SUN NS NUD & Probe send update
Simplify Probe parent check for Border router it save a code size. Stop send NUD if device is not ARO registred child or proper parent candidate. Change-Id: I197e45b47ed35da950631de2747eb8f4425e380b
1 parent f7133f8 commit f37dcf2

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,8 +1498,19 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
14981498
return false;
14991499
}
15001500

1501+
uint8_t ll_address[16];
1502+
15011503
if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT) {
15021504

1505+
ws_bootsrap_create_ll_address(ll_address, entry_ptr->mac64);
1506+
1507+
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, WS_NEIGHBOUR_MAX_CANDIDATE_PROBE)) {
1508+
if (!ipv6_neighbour_has_registered_by_eui64(&cur->ipv6_neighbour_cache, entry_ptr->mac64)) {
1509+
//NUD Not needed for if neighbour is not child or parent candidate
1510+
return false;
1511+
}
1512+
}
1513+
15031514
if (time_from_start > WS_NEIGHBOR_NUD_TIMEOUT * 1.5) {
15041515
activate_nud = true;
15051516
} else {
@@ -1518,14 +1529,10 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
15181529
//Accept quick Probe for init ETX
15191530
activate_nud = true;
15201531
} else {
1521-
if (cur->bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
1522-
return false; // Border router never probe automatically
1523-
} else {
1524-
uint8_t ll_address[16];
1525-
ws_bootsrap_create_ll_address(ll_address, entry_ptr->mac64);
1526-
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, WS_NEIGHBOUR_MAX_CANDIDATE_PROBE)) {
1527-
return false;
1528-
}
1532+
1533+
ws_bootsrap_create_ll_address(ll_address, entry_ptr->mac64);
1534+
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, WS_NEIGHBOUR_MAX_CANDIDATE_PROBE)) {
1535+
return false;
15291536
}
15301537

15311538
uint32_t probe_period = WS_PROBE_INIT_BASE_SECONDS << etx_entry->etx_samples;

0 commit comments

Comments
 (0)