@@ -100,6 +100,7 @@ static void protocol_6lowpan_neighbor_information_remove(int8_t interface_id, ml
100
100
static int8_t protocol_6lowpan_host_challenge (int8_t interface_id , const uint8_t * mac64 );
101
101
static int8_t protocol_6lowpan_router_challenge (int8_t interface_id , const uint8_t * mac64 );
102
102
static 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 );
103
104
104
105
static mle_6lowpan_data_t * mle_6lowpan_data ;
105
106
@@ -814,6 +815,7 @@ static bool mle_parent_link_req_cb(int8_t interface_id, uint16_t msgId, bool use
814
815
if (cur -> nwk_bootstrap_state == ER_MLE_LINK_REQ ) {
815
816
//Enter ND scan
816
817
bootsrap_next_state_kick (ER_SCAN , cur );
818
+ pan_coordinator_blacklist_free (& cur -> pan_cordinator_black_list );
817
819
}
818
820
#ifdef HAVE_RPL
819
821
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
842
844
case ER_MLE_LINK_REQ :
843
845
case ER_MLE_LINK_ADDRESS_SYNCH :
844
846
case ER_MLE_LINK_SHORT_SYNCH :
847
+ if (cur -> nwk_bootstrap_state == ER_MLE_LINK_REQ ) {
848
+ coordinator_black_list (cur );
849
+ }
845
850
tr_debug ("Link synch fail %u" , cur -> nwk_bootstrap_state );
846
851
bootsrap_next_state_kick (ER_BOOTSTRAP_CONNECTION_DOWN , cur );
847
852
break ;
@@ -2283,15 +2288,8 @@ static void nwk_6lowpan_bootsrap_pana_authentication_start(protocol_interface_in
2283
2288
2284
2289
#endif
2285
2290
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 )
2287
2292
{
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
2295
2293
uint8_t coord_pan_address [10 ];
2296
2294
addrtype_t cord_adr_type = mac_helper_coordinator_address_get (cur , coord_pan_address + 2 );
2297
2295
@@ -2304,6 +2302,18 @@ static void nwk_6lowpan_network_authentication_fail(protocol_interface_info_entr
2304
2302
2305
2303
pan_cordinator_blacklist_pan_set (& cur -> pan_cordinator_black_list , coord_pan_address , 300 );
2306
2304
}
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 );
2307
2317
2308
2318
nwk_bootsrap_state_update (ARM_NWK_AUHTENTICATION_FAIL , cur );
2309
2319
}
@@ -2379,6 +2389,7 @@ static void nwk_6lowpan_network_authentication_done(protocol_interface_info_entr
2379
2389
tr_debug ("Link request start fail" );
2380
2390
}
2381
2391
#else
2392
+ pan_coordinator_blacklist_free (& cur -> pan_cordinator_black_list );
2382
2393
cur -> nwk_bootstrap_state = ER_SCAN ;
2383
2394
nwk_6lowpan_router_scan_state (cur );
2384
2395
#endif
0 commit comments