76
76
#define TRACE_GROUP "wsbs"
77
77
78
78
79
-
80
79
static void ws_bootstrap_event_handler (arm_event_s * event );
81
80
static void ws_bootstrap_state_change (protocol_interface_info_entry_t * cur , icmp_state_t nwk_bootstrap_state );
82
81
static bool ws_bootstrap_state_discovery (struct protocol_interface_info_entry * cur );
@@ -221,11 +220,11 @@ static void ws_address_reregister_trig(struct protocol_interface_info_entry *int
221
220
222
221
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
222
{
224
-
225
223
/* No need for LL address registration */
226
224
if (addr -> source == ADDR_SOURCE_UNKNOWN || !interface -> ws_info ) {
227
225
return ;
228
226
}
227
+
229
228
if (reason == ADDR_CALLBACK_DAD_COMPLETE ) {
230
229
//If address is generated manually we need to force registration
231
230
if (addr -> source != ADDR_SOURCE_DHCP ) {
@@ -235,7 +234,10 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_
235
234
ws_address_registration_update (interface , addr -> address );
236
235
}
237
236
ws_address_reregister_trig (interface );
238
-
237
+ }
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;
239
241
}
240
242
} else if (reason == ADDR_CALLBACK_DELETED ) {
241
243
// What to do?
@@ -248,17 +250,17 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_
248
250
}
249
251
//Discover prefix policy
250
252
addr_policy_remove_by_label (WS_NON_PREFFRED_LABEL );
251
- }
252
253
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 ;
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
+ }
260
261
}
261
262
}
263
+
262
264
// Addressing in Wi-SUN interface was changed for Border router send new event so Application can update the state
263
265
if (interface -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER &&
264
266
interface -> nwk_bootstrap_state == ER_BOOTSRAP_DONE ) {
0 commit comments