@@ -624,6 +624,7 @@ bool rpl_instance_address_registration_done(protocol_interface_info_entry_t *int
624
624
addr -> addr_reg_done |= neighbour -> dao_path_control ;
625
625
/* State_timer is 1/10 s. Set renewal to 75-85% of lifetime */
626
626
addr -> state_timer = (addr -> preferred_lifetime * randLIB_get_random_in_range (75 , 85 ) / 10 );
627
+ neighbour -> dao_wait_after_registration = 6 ;
627
628
} else {
628
629
tr_error ("Address registration failed" );
629
630
rpl_delete_neighbour (instance , neighbour );
@@ -640,6 +641,30 @@ bool rpl_instance_address_registration_done(protocol_interface_info_entry_t *int
640
641
return false;
641
642
}
642
643
644
+ static bool rpl_instance_dao_address_reg_pending_check (rpl_instance_t * instance )
645
+ {
646
+ //Validate that there is no pending address at list
647
+ rpl_neighbour_t * neighbour = ns_list_get_first (& instance -> candidate_neighbours );
648
+ if (!neighbour ) {
649
+ return true;
650
+ }
651
+ protocol_interface_info_entry_t * cur = protocol_stack_interface_info_get_by_id (neighbour -> interface_id );
652
+ if (!cur ) {
653
+ return true;
654
+ }
655
+
656
+ ns_list_foreach (if_address_entry_t , addr , & cur -> ip_addresses ) {
657
+
658
+ /* Optimize, ll addresses are not registered anyway.. */
659
+ if (!addr_is_ipv6_link_local (addr -> address ) && addr -> addr_reg_pend ) {
660
+ return true;
661
+ }
662
+ }
663
+
664
+ return false;
665
+ }
666
+
667
+
643
668
/* We are optimised for sending updates to existing targets to current parents;
644
669
* we track the state of what information DAO parents have, and manage the
645
670
* updates together with message coalescing and ack tracking.
@@ -673,6 +698,20 @@ void rpl_instance_send_dao_update(rpl_instance_t *instance)
673
698
return ;
674
699
}
675
700
701
+ //Verify that no pending address registartion to parent
702
+ if (rpl_instance_dao_address_reg_pending_check (instance )) {
703
+ rpl_instance_dao_trigger (instance , 6 * 10 );
704
+ return ;
705
+ }
706
+
707
+ //Verify that no pending dao wait time
708
+ ns_list_foreach_safe (rpl_neighbour_t , n , & instance -> candidate_neighbours ) {
709
+ if (n -> dodag_parent && n -> dao_wait_after_registration ) {
710
+ rpl_instance_dao_trigger (instance , n -> dao_wait_after_registration * 10 );
711
+ return ;
712
+ }
713
+ }
714
+
676
715
if (instance -> dao_in_transit ) {
677
716
// Force current DAO timeout to be cut short, then
678
717
// when it times out, it will re-evaluate the situation,
0 commit comments