Merge pull request #418 from simonduq/fix/rpl-various

A variety of minor RPL enhancements
This commit is contained in:
Simon Duquennoy 2018-04-14 09:55:59 +02:00 committed by GitHub
commit ebd34a3c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View File

@ -183,14 +183,14 @@ void
rpl_refresh_routes(const char *str)
{
if(rpl_dag_root_is_root()) {
LOG_WARN("incrementing DTSN (%s), current %u)\n",
/* Increment DTSN */
RPL_LOLLIPOP_INCREMENT(curr_instance.dtsn_out);
LOG_WARN("incremented DTSN (%s), current %u\n",
str, curr_instance.dtsn_out);
if(LOG_INFO_ENABLED) {
rpl_neighbor_print_list("Refresh routes (before)");
}
/* Increment DTSN */
RPL_LOLLIPOP_INCREMENT(curr_instance.dtsn_out);
}
}
/*---------------------------------------------------------------------------*/
@ -198,15 +198,16 @@ void
rpl_global_repair(const char *str)
{
if(rpl_dag_root_is_root()) {
LOG_WARN("initiating global repair (%s), version %u, rank %u)\n",
RPL_LOLLIPOP_INCREMENT(curr_instance.dag.version); /* New DAG version */
curr_instance.dtsn_out = RPL_LOLLIPOP_INIT; /* Re-initialize DTSN */
LOG_WARN("initiating global repair (%s), version %u, rank %u\n",
str, curr_instance.dag.version, curr_instance.dag.rank);
if(LOG_INFO_ENABLED) {
rpl_neighbor_print_list("Global repair (before)");
}
/* Initiate global repair */
RPL_LOLLIPOP_INCREMENT(curr_instance.dag.version); /* New DAG version */
RPL_LOLLIPOP_INCREMENT(curr_instance.dtsn_out); /* Request new DAOs */
/* Now do a local repair to disseminate the new version */
rpl_local_repair("Global repair");
}
}
@ -215,12 +216,13 @@ static void
global_repair_non_root(rpl_dio_t *dio)
{
if(!rpl_dag_root_is_root()) {
LOG_WARN("participating in global repair, version %u, rank %u)\n",
curr_instance.dag.version, curr_instance.dag.rank);
LOG_WARN("participating in global repair, version %u, rank %u\n",
dio->version, curr_instance.dag.rank);
if(LOG_INFO_ENABLED) {
rpl_neighbor_print_list("Global repair (before)");
}
/* Re-initialize configuration from DIO */
rpl_timers_stop_dag_timers();
init_dag_from_dio(dio);
rpl_local_repair("Global repair");
}
@ -459,7 +461,7 @@ process_dio_from_current_dag(uip_ipaddr_t *from, rpl_dio_t *dio)
if(curr_instance.mop != RPL_MOP_NO_DOWNWARD_ROUTES) {
if(nbr != NULL && nbr == curr_instance.dag.preferred_parent && rpl_lollipop_greater_than(dio->dtsn, last_dtsn)) {
RPL_LOLLIPOP_INCREMENT(curr_instance.dtsn_out);
LOG_INFO("DTSN increment %u->%u, schedule new DAO with DTSN %u",
LOG_WARN("DTSN increment %u->%u, schedule new DAO with DTSN %u\n",
last_dtsn, dio->dtsn, curr_instance.dtsn_out);
rpl_timers_schedule_dao();
}

View File

@ -435,7 +435,7 @@ handle_probing_timer(void *ptr)
LOG_INFO_6ADDR(target_ipaddr);
LOG_INFO_(" %s last tx %u min ago\n",
curr_instance.dag.urgent_probing_target != NULL ? "(urgent)" : "",
probing_target != NULL ?
stats != NULL ?
(unsigned)((clock_time() - stats->last_tx_time) / (60 * CLOCK_SECOND)) : 0
);
/* Send probe, e.g. unicast DIO or DIS */

View File

@ -174,7 +174,7 @@ PT_THREAD(cmd_rpl_status(struct pt *pt, shell_output_func output, char *args))
SHELL_OUTPUT(output, "-- State: %s\n", rpl_state_to_str(curr_instance.dag.state));
SHELL_OUTPUT(output, "-- Preferred parent: ");
shell_output_6addr(output, rpl_neighbor_get_ipaddr(curr_instance.dag.preferred_parent));
SHELL_OUTPUT(output, "\n");
SHELL_OUTPUT(output, " (last DTSN: %u)\n", curr_instance.dag.preferred_parent->dtsn);
SHELL_OUTPUT(output, "-- Rank: %u\n", curr_instance.dag.rank);
SHELL_OUTPUT(output, "-- Lowest rank: %u (%u)\n", curr_instance.dag.lowest_rank, curr_instance.max_rankinc);
SHELL_OUTPUT(output, "-- DTSN out: %u\n", curr_instance.dtsn_out);