@@ -317,7 +317,7 @@ nullify_parents(rpl_dag_t *dag, rpl_rank_t minimum_rank)
317
317
}
318
318
/*---------------------------------------------------------------------------*/
319
319
static int
320
- should_send_dao (rpl_instance_t * instance , rpl_dio_t * dio , rpl_parent_t * p )
320
+ should_refresh_routes (rpl_instance_t * instance , rpl_dio_t * dio , rpl_parent_t * p )
321
321
{
322
322
/* if MOP is set to no downward routes no DAO should be sent */
323
323
if (instance -> mop == RPL_MOP_NO_DOWNWARD_ROUTES ) {
@@ -841,12 +841,16 @@ rpl_select_dag(rpl_instance_t *instance, rpl_parent_t *p)
841
841
PRINTF ("RPL: Changed preferred parent, rank changed from %u to %u\n" ,
842
842
(unsigned )old_rank , best_dag -> rank );
843
843
RPL_STAT (rpl_stats .parent_switch ++ );
844
- if (RPL_IS_STORING (instance ) && last_parent != NULL ) {
845
- /* Send a No-Path DAO to the removed preferred parent. */
846
- dao_output (last_parent , RPL_ZERO_LIFETIME );
844
+ if (RPL_IS_STORING (instance )) {
845
+ if (last_parent != NULL ) {
846
+ /* Send a No-Path DAO to the removed preferred parent. */
847
+ dao_output (last_parent , RPL_ZERO_LIFETIME );
848
+ }
849
+ /* Trigger DAO transmission from immediate children.
850
+ * Only for storing mode, see RFC6550 section 9.6. */
851
+ RPL_LOLLIPOP_INCREMENT (instance -> dtsn_out );
847
852
}
848
853
/* The DAO parent set changed - schedule a DAO transmission. */
849
- RPL_LOLLIPOP_INCREMENT (instance -> dtsn_out );
850
854
rpl_schedule_dao (instance );
851
855
rpl_reset_dio_timer (instance );
852
856
#if DEBUG
@@ -1332,8 +1336,12 @@ rpl_local_repair(rpl_instance_t *instance)
1332
1336
instance -> has_downward_route = 0 ;
1333
1337
1334
1338
rpl_reset_dio_timer (instance );
1335
- /* Request refresh of DAO registrations next DIO */
1336
- RPL_LOLLIPOP_INCREMENT (instance -> dtsn_out );
1339
+ if (RPL_IS_STORING (instance )) {
1340
+ /* Request refresh of DAO registrations next DIO. Only for storing mode. In
1341
+ * non-storing mode, non-root nodes increment DTSN only on when their parent do,
1342
+ * or on global repair (see RFC6550 section 9.6.) */
1343
+ RPL_LOLLIPOP_INCREMENT (instance -> dtsn_out );
1344
+ }
1337
1345
1338
1346
RPL_STAT (rpl_stats .local_repairs ++ );
1339
1347
}
@@ -1622,7 +1630,9 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
1622
1630
1623
1631
/* We don't use route control, so we can have only one official parent. */
1624
1632
if (dag -> joined && p == dag -> preferred_parent ) {
1625
- if (should_send_dao (instance , dio , p )) {
1633
+ if (should_refresh_routes (instance , dio , p )) {
1634
+ /* Our parent is requesting a new DAO. Increment DTSN in turn,
1635
+ * in both storing and non-storing mode (see RFC6550 section 9.6.) */
1626
1636
RPL_LOLLIPOP_INCREMENT (instance -> dtsn_out );
1627
1637
rpl_schedule_dao (instance );
1628
1638
}
0 commit comments