@@ -104,7 +104,7 @@ static void ws_nud_entry_remove(protocol_interface_info_entry_t *cur, mac_neighb
104
104
static bool ws_neighbor_entry_nud_notify (mac_neighbor_table_entry_t * entry_ptr , void * user_data );
105
105
106
106
static void ws_address_registration_update (protocol_interface_info_entry_t * interface , const uint8_t addr [16 ]);
107
- static int8_t ws_bootstrap_neighbor_set (protocol_interface_info_entry_t * cur , parent_info_t * parent_ptr );
107
+ static int8_t ws_bootstrap_neighbor_set (protocol_interface_info_entry_t * cur , parent_info_t * parent_ptr , bool clear_list );
108
108
109
109
static void ws_bootstrap_candidate_table_reset (protocol_interface_info_entry_t * cur );
110
110
static parent_info_t * ws_bootstrap_candidate_parent_get (struct protocol_interface_info_entry * cur , const uint8_t * addr , bool create );
@@ -2769,7 +2769,7 @@ static const uint8_t *ws_bootstrap_authentication_next_target(protocol_interface
2769
2769
if (parent_info ) {
2770
2770
/* On failure still continues with the new parent, and on next call,
2771
2771
will try to set the neighbor again */
2772
- ws_bootstrap_neighbor_set (cur , parent_info );
2772
+ ws_bootstrap_neighbor_set (cur , parent_info , true );
2773
2773
* pan_id = parent_info -> pan_id ;
2774
2774
return parent_info -> addr ;
2775
2775
}
@@ -3167,7 +3167,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
3167
3167
}
3168
3168
}
3169
3169
3170
- static int8_t ws_bootstrap_neighbor_set (protocol_interface_info_entry_t * cur , parent_info_t * parent_ptr )
3170
+ static int8_t ws_bootstrap_neighbor_set (protocol_interface_info_entry_t * cur , parent_info_t * parent_ptr , bool clear_list )
3171
3171
{
3172
3172
uint16_t pan_id = cur -> ws_info -> network_pan_id ;
3173
3173
@@ -3178,7 +3178,9 @@ static int8_t ws_bootstrap_neighbor_set(protocol_interface_info_entry_t *cur, pa
3178
3178
3179
3179
// If PAN ID changes, clear learned neighbors and activate FHSS
3180
3180
if (pan_id != cur -> ws_info -> network_pan_id ) {
3181
- ws_bootstrap_neighbor_list_clean (cur );
3181
+ if (clear_list ) {
3182
+ ws_bootstrap_neighbor_list_clean (cur );
3183
+ }
3182
3184
ws_bootstrap_fhss_activate (cur );
3183
3185
}
3184
3186
@@ -3221,7 +3223,7 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
3221
3223
}
3222
3224
tr_info ("selected parent:%s panid %u" , trace_array (selected_parent_ptr -> addr , 8 ), selected_parent_ptr -> pan_id );
3223
3225
3224
- if (ws_bootstrap_neighbor_set (cur , selected_parent_ptr ) < 0 ) {
3226
+ if (ws_bootstrap_neighbor_set (cur , selected_parent_ptr , false ) < 0 ) {
3225
3227
goto select_best_candidate ;
3226
3228
}
3227
3229
0 commit comments