@@ -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
@@ -663,17 +664,17 @@ static uint16_t mle_router_synch(protocol_interface_info_entry_t *cur, const uin
663
664
if (retrans ) {
664
665
if (destAddress ) {
665
666
timeout .retrans_max = 3 ;
666
- timeout .timeout_init = 1 ;
667
- timeout .timeout_max = 3 ;
667
+ timeout .timeout_init = 2 ;
668
+ timeout .timeout_max = 4 ;
668
669
} else {
669
670
timeout .retrans_max = 2 ;
670
- timeout .timeout_init = 2 ;
671
+ timeout .timeout_init = 4 ;
671
672
timeout .timeout_max = 4 ;
672
673
}
673
674
} else {
674
675
timeout .retrans_max = 1 ;
675
- timeout .timeout_init = 1 ;
676
- timeout .timeout_max = 3 ;
676
+ timeout .timeout_init = 2 ;
677
+ timeout .timeout_max = 4 ;
677
678
}
678
679
679
680
timeout .delay = delay ;
@@ -706,7 +707,7 @@ static int mle_router_accept_request_build(protocol_interface_info_entry_t *cur,
706
707
bufId = mle_service_msg_allocate (cur -> id , 64 , true,type );
707
708
timeout .retrans_max = 2 ;
708
709
timeout .timeout_init = 2 ;
709
- timeout .timeout_max = 2 ;
710
+ timeout .timeout_max = 4 ;
710
711
}
711
712
712
713
if (bufId == 0 ) {
@@ -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 ) {
@@ -840,12 +842,19 @@ static bool mle_parent_link_req_cb(int8_t interface_id, uint16_t msgId, bool use
840
842
if (usedAllRetries ) {
841
843
switch (cur -> nwk_bootstrap_state ) {
842
844
case ER_MLE_LINK_REQ :
843
- case ER_ROUTER_SYNCH :
844
845
case ER_MLE_LINK_ADDRESS_SYNCH :
845
846
case ER_MLE_LINK_SHORT_SYNCH :
847
+ if (cur -> nwk_bootstrap_state == ER_MLE_LINK_REQ ) {
848
+ coordinator_black_list (cur );
849
+ }
846
850
tr_debug ("Link synch fail %u" , cur -> nwk_bootstrap_state );
847
851
bootsrap_next_state_kick (ER_BOOTSTRAP_CONNECTION_DOWN , cur );
848
852
break ;
853
+ #ifdef HAVE_RPL
854
+ case ER_ROUTER_SYNCH :
855
+ bootsrap_next_state_kick (ER_RPL_MC , cur );
856
+ break ;
857
+ #endif // HAVE_RPL
849
858
default :
850
859
break ;
851
860
}
@@ -869,6 +878,7 @@ static bool mle_accept_request_cb(int8_t interface_id, uint16_t msgId, bool used
869
878
//If message has been sent by MLE service sends MLE reject to clear link
870
879
if (mle_service_check_msg_sent (msgId )) {
871
880
uint8_t * address_ptr = mle_service_get_msg_destination_address_pointer (msgId );
881
+ tr_debug ("No accept for Accept/Request" );
872
882
mle_service_reject_message_build (cur -> id , address_ptr , false);
873
883
}
874
884
return false;
@@ -2278,15 +2288,8 @@ static void nwk_6lowpan_bootsrap_pana_authentication_start(protocol_interface_in
2278
2288
2279
2289
#endif
2280
2290
2281
- 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 )
2282
2292
{
2283
- nwk_scan_params_t * scan_params =
2284
- & cur -> mac_parameters -> nwk_scan_params ;
2285
-
2286
- tr_warn ("Pana Auhth er" );
2287
-
2288
- scan_params -> nwk_cur_active = mac_helper_free_pan_descriptions (scan_params -> nwk_cur_active );
2289
- //Black List coordinator
2290
2293
uint8_t coord_pan_address [10 ];
2291
2294
addrtype_t cord_adr_type = mac_helper_coordinator_address_get (cur , coord_pan_address + 2 );
2292
2295
@@ -2299,6 +2302,18 @@ static void nwk_6lowpan_network_authentication_fail(protocol_interface_info_entr
2299
2302
2300
2303
pan_cordinator_blacklist_pan_set (& cur -> pan_cordinator_black_list , coord_pan_address , 300 );
2301
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 );
2302
2317
2303
2318
nwk_bootsrap_state_update (ARM_NWK_AUHTENTICATION_FAIL , cur );
2304
2319
}
@@ -2374,6 +2389,7 @@ static void nwk_6lowpan_network_authentication_done(protocol_interface_info_entr
2374
2389
tr_debug ("Link request start fail" );
2375
2390
}
2376
2391
#else
2392
+ pan_coordinator_blacklist_free (& cur -> pan_cordinator_black_list );
2377
2393
cur -> nwk_bootstrap_state = ER_SCAN ;
2378
2394
nwk_6lowpan_router_scan_state (cur );
2379
2395
#endif
@@ -2538,7 +2554,7 @@ void protocol_6lowpan_mac_scan_confirm(int8_t if_id, const mlme_scan_conf_t* con
2538
2554
2539
2555
void bootstrap_timer_handle (uint16_t ticks )
2540
2556
{
2541
- ticks ;
2557
+ ( void ) ticks ;
2542
2558
ns_list_foreach (protocol_interface_info_entry_t , cur , & protocol_interface_info_list ) {
2543
2559
if (cur -> nwk_id == IF_6LoWPAN ) {
2544
2560
if (cur -> nwk_bootstrap_state == ER_ACTIVE_SCAN || cur -> nwk_bootstrap_state == ER_WARM_ACTIVE_SCAN ) {
@@ -2728,6 +2744,7 @@ static void protocol_6lowpan_generate_link_reject(protocol_interface_info_entry_
2728
2744
address [8 ] ^= 2 ;
2729
2745
}
2730
2746
if (mac_helper_default_security_level_get (cur )) {
2747
+ tr_debug ("Drop link by asymmetric security" );
2731
2748
mle_service_reject_message_build (cur -> id , address , false);
2732
2749
return ;
2733
2750
}
0 commit comments