@@ -100,6 +100,7 @@ static void protocol_6lowpan_neighbor_information_remove(int8_t interface_id, ml
100100static int8_t protocol_6lowpan_host_challenge (int8_t interface_id , const uint8_t * mac64 );
101101static int8_t protocol_6lowpan_router_challenge (int8_t interface_id , const uint8_t * mac64 );
102102static void protocol_6lowpan_address_reg_ready (protocol_interface_info_entry_t * cur_interface );
103+ static void coordinator_black_list (protocol_interface_info_entry_t * cur );
103104
104105static mle_6lowpan_data_t * mle_6lowpan_data ;
105106
@@ -814,6 +815,7 @@ static bool mle_parent_link_req_cb(int8_t interface_id, uint16_t msgId, bool use
814815 if (cur -> nwk_bootstrap_state == ER_MLE_LINK_REQ ) {
815816 //Enter ND scan
816817 bootsrap_next_state_kick (ER_SCAN , cur );
818+ pan_coordinator_blacklist_free (& cur -> pan_cordinator_black_list );
817819 }
818820#ifdef HAVE_RPL
819821 else if (cur -> nwk_bootstrap_state == ER_ROUTER_SYNCH ) {
@@ -842,6 +844,9 @@ static bool mle_parent_link_req_cb(int8_t interface_id, uint16_t msgId, bool use
842844 case ER_MLE_LINK_REQ :
843845 case ER_MLE_LINK_ADDRESS_SYNCH :
844846 case ER_MLE_LINK_SHORT_SYNCH :
847+ if (cur -> nwk_bootstrap_state == ER_MLE_LINK_REQ ) {
848+ coordinator_black_list (cur );
849+ }
845850 tr_debug ("Link synch fail %u" , cur -> nwk_bootstrap_state );
846851 bootsrap_next_state_kick (ER_BOOTSTRAP_CONNECTION_DOWN , cur );
847852 break ;
@@ -2283,15 +2288,8 @@ static void nwk_6lowpan_bootsrap_pana_authentication_start(protocol_interface_in
22832288
22842289#endif
22852290
2286- static void nwk_6lowpan_network_authentication_fail (protocol_interface_info_entry_t * cur )
2291+ static void coordinator_black_list (protocol_interface_info_entry_t * cur )
22872292{
2288- nwk_scan_params_t * scan_params =
2289- & cur -> mac_parameters -> nwk_scan_params ;
2290-
2291- tr_warn ("Pana Auhth er" );
2292-
2293- scan_params -> nwk_cur_active = mac_helper_free_pan_descriptions (scan_params -> nwk_cur_active );
2294- //Black List coordinator
22952293 uint8_t coord_pan_address [10 ];
22962294 addrtype_t cord_adr_type = mac_helper_coordinator_address_get (cur , coord_pan_address + 2 );
22972295
@@ -2304,6 +2302,18 @@ static void nwk_6lowpan_network_authentication_fail(protocol_interface_info_entr
23042302
23052303 pan_cordinator_blacklist_pan_set (& cur -> pan_cordinator_black_list , coord_pan_address , 300 );
23062304 }
2305+ }
2306+
2307+ static void nwk_6lowpan_network_authentication_fail (protocol_interface_info_entry_t * cur )
2308+ {
2309+ nwk_scan_params_t * scan_params =
2310+ & cur -> mac_parameters -> nwk_scan_params ;
2311+
2312+ tr_warn ("Pana Auhth er" );
2313+
2314+ scan_params -> nwk_cur_active = mac_helper_free_pan_descriptions (scan_params -> nwk_cur_active );
2315+ //Black List coordinator
2316+ coordinator_black_list (cur );
23072317
23082318 nwk_bootsrap_state_update (ARM_NWK_AUHTENTICATION_FAIL , cur );
23092319}
@@ -2379,6 +2389,7 @@ static void nwk_6lowpan_network_authentication_done(protocol_interface_info_entr
23792389 tr_debug ("Link request start fail" );
23802390 }
23812391#else
2392+ pan_coordinator_blacklist_free (& cur -> pan_cordinator_black_list );
23822393 cur -> nwk_bootstrap_state = ER_SCAN ;
23832394 nwk_6lowpan_router_scan_state (cur );
23842395#endif
0 commit comments