@@ -124,14 +124,27 @@ static void ws_bootstrap_address_notification_cb(struct protocol_interface_info_
124
124
if (addr -> source == ADDR_SOURCE_UNKNOWN ) {
125
125
return ;
126
126
}
127
-
128
127
if (reason == ADDR_CALLBACK_DAD_COMPLETE ) {
129
128
//Trig Address Registartion only when Bootstrap is ready
130
129
if (interface -> nwk_bootstrap_state == ER_BOOTSRAP_DONE ) {
131
130
ws_bootsrap_event_trig (WS_ADDRESS_ADDED , interface -> bootStrapId , ARM_LIB_LOW_PRIORITY_EVENT , (void * )addr );
132
131
}
132
+ if (addr_ipv6_scope (addr -> address ,interface ) > IPV6_SCOPE_LINK_LOCAL ) {
133
+ // at least ula address available inside mesh.
134
+ interface -> global_address_available = true;
135
+ }
136
+
133
137
} else if (reason == ADDR_CALLBACK_DELETED ) {
134
138
// What to do?
139
+ // Go through address list and check if there is global address still available
140
+ interface -> global_address_available = false;
141
+ ns_list_foreach (if_address_entry_t , addr_str , & interface -> ip_addresses ) {
142
+ if (addr_ipv6_scope (addr_str -> address , interface ) > IPV6_SCOPE_LINK_LOCAL ) {
143
+ // at least ula address available inside mesh.
144
+ interface -> global_address_available = true;
145
+ break ;
146
+ }
147
+ }
135
148
}
136
149
}
137
150
@@ -1588,7 +1601,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
1588
1601
break ;
1589
1602
case WS_DISCOVERY_START :
1590
1603
tr_info ("Discovery start" );
1591
- // All trikkles stopped so here can be entered anytime
1604
+ // All trickle timers stopped to allow entry from any state
1592
1605
cur -> ws_info -> trickle_pa_running = false;
1593
1606
cur -> ws_info -> trickle_pc_running = false;
1594
1607
cur -> ws_info -> trickle_pas_running = false;
0 commit comments