Skip to content

Commit 6b8beef

Browse files
author
Mika Leppänen
committed
Clear all neighbors only on eapol next target check
1 parent faa19e1 commit 6b8beef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void ws_nud_entry_remove(protocol_interface_info_entry_t *cur, mac_neighb
104104
static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data);
105105

106106
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);
108108

109109
static void ws_bootstrap_candidate_table_reset(protocol_interface_info_entry_t *cur);
110110
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
27692769
if (parent_info) {
27702770
/* On failure still continues with the new parent, and on next call,
27712771
will try to set the neighbor again */
2772-
ws_bootstrap_neighbor_set(cur, parent_info);
2772+
ws_bootstrap_neighbor_set(cur, parent_info, true);
27732773
*pan_id = parent_info->pan_id;
27742774
return parent_info->addr;
27752775
}
@@ -3167,7 +3167,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
31673167
}
31683168
}
31693169

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)
31713171
{
31723172
uint16_t pan_id = cur->ws_info->network_pan_id;
31733173

@@ -3178,7 +3178,9 @@ static int8_t ws_bootstrap_neighbor_set(protocol_interface_info_entry_t *cur, pa
31783178

31793179
// If PAN ID changes, clear learned neighbors and activate FHSS
31803180
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+
}
31823184
ws_bootstrap_fhss_activate(cur);
31833185
}
31843186

@@ -3221,7 +3223,7 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
32213223
}
32223224
tr_info("selected parent:%s panid %u", trace_array(selected_parent_ptr->addr, 8), selected_parent_ptr->pan_id);
32233225

3224-
if (ws_bootstrap_neighbor_set(cur, selected_parent_ptr) < 0) {
3226+
if (ws_bootstrap_neighbor_set(cur, selected_parent_ptr, false) < 0) {
32253227
goto select_best_candidate;
32263228
}
32273229

0 commit comments

Comments
 (0)