Skip to content

Commit 145c739

Browse files
author
Juha Heiskanen
committed
Wi-sun address registration trigger update
Removed wi-sun address registaretion trigger from DHCP addressd status OK callback. Fixed SLAAC address re-registration trigger. Wi-sun will do address registartion periodically automatically. DHCP only start re-register timer. Change-Id: I768c0eac494a598afa5178079180b7190b9e277a
1 parent d492575 commit 145c739

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,28 @@ static void ws_bootstrap_neighbor_list_clean(struct protocol_interface_info_entr
153153
mac_neighbor_table_neighbor_list_clean(mac_neighbor_info(interface));
154154
}
155155

156+
static void ws_address_reregister_trig(struct protocol_interface_info_entry *interface)
157+
{
158+
if (interface->ws_info->aro_registration_timer == 0) {
159+
interface->ws_info->aro_registration_timer = WS_NEIGHBOR_NUD_TIMEOUT;
160+
}
161+
}
162+
156163
static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_entry *interface, const struct if_address_entry *addr, if_address_callback_t reason)
157164
{
158165
/* No need for LL address registration */
159-
if (addr->source == ADDR_SOURCE_UNKNOWN) {
166+
if (addr->source == ADDR_SOURCE_UNKNOWN || !interface->ws_info) {
160167
return;
161168
}
162169
if (reason == ADDR_CALLBACK_DAD_COMPLETE) {
163170
//Trig Address Registartion only when Bootstrap is ready
164-
if (interface->nwk_bootstrap_state == ER_BOOTSRAP_DONE && addr->source != ADDR_SOURCE_DHCP) {
165-
tr_debug("Address registration %s", trace_ipv6(addr->address));
166-
ws_address_registration_update(interface, addr->address);
171+
if (addr->source != ADDR_SOURCE_DHCP) {
172+
if (interface->nwk_bootstrap_state == ER_BOOTSRAP_DONE) {
173+
tr_debug("Address registration %s", trace_ipv6(addr->address));
174+
ws_address_registration_update(interface, addr->address);
175+
}
176+
ws_address_reregister_trig(interface);
177+
167178
}
168179
if (addr_ipv6_scope(addr->address, interface) > IPV6_SCOPE_LINK_LOCAL) {
169180
// at least ula address available inside mesh.
@@ -190,12 +201,6 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_
190201
break;
191202
}
192203
}
193-
} else if (reason == ADDR_CALLBACK_TIMER) {
194-
if (addr->source != ADDR_SOURCE_DHCP) {
195-
tr_debug("Address Re registration %s", trace_ipv6(addr->address));
196-
//Register
197-
ws_address_registration_update(interface, addr->address);
198-
}
199204
}
200205
}
201206

@@ -2089,7 +2094,7 @@ static void ws_dhcp_client_global_adress_cb(int8_t interface, uint8_t dhcp_addr[
20892094
if (register_status) {
20902095
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface);
20912096
if (cur) {
2092-
ws_address_registration_update(cur, prefix);
2097+
ws_address_reregister_trig(cur);
20932098
}
20942099
} else {
20952100
//Delete dhcpv6 client

source/RPL/rpl_downward.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static bool rpl_instance_parent_selection_ready(rpl_instance_t *instance)
182182
{
183183
rpl_neighbour_t *neighbour = ns_list_get_first(&instance->candidate_neighbours);
184184
if (neighbour && neighbour->dodag_parent && neighbour->dao_path_control) {
185-
//We have a Primary parent with Dao patha control
185+
//We have a Primary parent with Dao path control
186186
return true;
187187
}
188188
return false;

0 commit comments

Comments
 (0)