Send a no-path DAO when becoming feather mode, so that the network can drop routes to us, which are no longer needed

This commit is contained in:
Adam Dunkels 2015-08-26 16:47:10 +02:00
parent 32511dc512
commit 9cd84563cb

View File

@ -89,11 +89,17 @@ rpl_set_mode(enum rpl_mode m)
} else if(m == RPL_MODE_FEATHER) {
PRINTF("RPL: switching to feather mode\n");
mode = m;
if(default_instance != NULL) {
PRINTF("rpl_set_mode: RPL sending DAO with zero lifetime\n");
if(default_instance->current_dag != NULL) {
dao_output(default_instance->current_dag->preferred_parent, RPL_ZERO_LIFETIME);
}
rpl_cancel_dao(default_instance);
} else {
PRINTF("rpl_set_mode: no default instance\n");
}
mode = m;
} else {
mode = m;
}