@@ -221,25 +221,22 @@ static void ws_address_reregister_trig(struct protocol_interface_info_entry *int
221
221
222
222
static void ws_bootstrap_address_notification_cb (struct protocol_interface_info_entry * interface , const struct if_address_entry * addr , if_address_callback_t reason )
223
223
{
224
+
224
225
/* No need for LL address registration */
225
226
if (addr -> source == ADDR_SOURCE_UNKNOWN || !interface -> ws_info ) {
226
227
return ;
227
228
}
228
229
if (reason == ADDR_CALLBACK_DAD_COMPLETE ) {
229
- //Trig Address Registartion only when Bootstrap is ready
230
+ //If address is generated manually we need to force registration
230
231
if (addr -> source != ADDR_SOURCE_DHCP ) {
232
+ //Trigger Address Registration only when Bootstrap is ready
231
233
if (interface -> nwk_bootstrap_state == ER_BOOTSRAP_DONE ) {
232
234
tr_debug ("Address registration %s" , trace_ipv6 (addr -> address ));
233
235
ws_address_registration_update (interface , addr -> address );
234
236
}
235
237
ws_address_reregister_trig (interface );
236
238
237
239
}
238
- if (addr_ipv6_scope (addr -> address , interface ) > IPV6_SCOPE_LINK_LOCAL ) {
239
- // at least ula address available inside mesh.
240
- interface -> global_address_available = true;
241
- }
242
-
243
240
} else if (reason == ADDR_CALLBACK_DELETED ) {
244
241
// What to do?
245
242
// Go through address list and check if there is global address still available
@@ -251,14 +248,22 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_
251
248
}
252
249
//Discover prefix policy
253
250
addr_policy_remove_by_label (WS_NON_PREFFRED_LABEL );
251
+ }
254
252
255
- interface -> global_address_available = false;
256
- ns_list_foreach (if_address_entry_t , addr_str , & interface -> ip_addresses ) {
257
- if (addr_ipv6_scope (addr_str -> address , interface ) > IPV6_SCOPE_LINK_LOCAL ) {
258
- // at least ula address available inside mesh.
259
- interface -> global_address_available = true;
260
- break ;
261
- }
253
+ // Check the Address status if we have global address available.
254
+ interface -> global_address_available = false;
255
+ ns_list_foreach (if_address_entry_t , addr_str , & interface -> ip_addresses ) {
256
+ if (addr_ipv6_scope (addr_str -> address , interface ) > IPV6_SCOPE_LINK_LOCAL ) {
257
+ // at least ula address available inside mesh.
258
+ interface -> global_address_available = true;
259
+ break ;
260
+ }
261
+ }
262
+ // Addressing in Wi-SUN interface was changed for Border router send new event so Application can update the state
263
+ if (interface -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER &&
264
+ interface -> nwk_bootstrap_state == ER_BOOTSRAP_DONE ) {
265
+ if (interface -> bootsrap_state_machine_cnt == 0 ) {
266
+ interface -> bootsrap_state_machine_cnt = 10 ; //Re trigger state check
262
267
}
263
268
}
264
269
}
@@ -3222,11 +3227,7 @@ void ws_bootstrap_configure_process(protocol_interface_info_entry_t *cur)
3222
3227
3223
3228
if (cur -> ws_info -> configuration_learned ) {
3224
3229
ws_bootstrap_network_configuration_learn (cur );
3225
-
3226
-
3227
3230
ws_bootstrap_event_operation_start (cur );
3228
-
3229
-
3230
3231
return ;
3231
3232
}
3232
3233
return ;
0 commit comments