From 66ec94fd74adc3fd6410b3a3e426ccf7666e4ed0 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 17 Sep 2015 22:42:59 +0200 Subject: [PATCH] Minor improvements to RPL probing --- core/net/rpl/rpl-timers.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/net/rpl/rpl-timers.c b/core/net/rpl/rpl-timers.c index f9d8f84e4..50300f900 100644 --- a/core/net/rpl/rpl-timers.c +++ b/core/net/rpl/rpl-timers.c @@ -414,13 +414,15 @@ handle_probing_timer(void *ptr) { rpl_instance_t *instance = (rpl_instance_t *)ptr; rpl_parent_t *probing_target = RPL_PROBING_SELECT_FUNC(instance->current_dag); + uip_ipaddr_t *target_ipaddr = rpl_get_parent_ipaddr(probing_target); /* Perform probing */ - if(probing_target != NULL && rpl_get_parent_ipaddr(probing_target) != NULL) { - PRINTF("RPL: probing %3u\n", - nbr_table_get_lladdr(rpl_parents, probing_target)->u8[7]); - /* Send probe, e.g. unicast DIO or DIS */ - RPL_PROBING_SEND_FUNC(instance, rpl_get_parent_ipaddr(probing_target)); + if(target_ipaddr != NULL) { + PRINTF("RPL: probing %u ((last tx %u min ago))\n", + nbr_table_get_lladdr(rpl_parents, probing_target)->u8[7], + (unsigned)((clock_time() - probing_target->last_tx_time) / (60 * CLOCK_SECOND))); + /* Send probe (unicast DIO or DIS) */ + RPL_PROBING_SEND_FUNC(instance, target_ipaddr); } /* Schedule next probing */