Print an entry for the root node as well as other entries
@@ -120,17 +120,20 @@ print_network_status(void)
PRINTF("- Routing links (%u in total):\n", rpl_ns_num_nodes());
link = rpl_ns_node_head();
while(link != NULL) {
- if(link->parent != NULL) {
uip_ipaddr_t child_ipaddr;
uip_ipaddr_t parent_ipaddr;
rpl_ns_get_node_global_addr(&child_ipaddr, link);
rpl_ns_get_node_global_addr(&parent_ipaddr, link->parent);
PRINTF("-- ");
PRINT6ADDR(&child_ipaddr);
+ if(link->parent == NULL) {
+ memset(&parent_ipaddr, 0, sizeof(parent_ipaddr));
+ PRINTF(" --- DODAG root ");
+ } else {
PRINTF(" to ");
PRINT6ADDR(&parent_ipaddr);
- PRINTF(" (lifetime: %lu seconds)\n", (unsigned long)link->lifetime);
}
+ PRINTF(" (lifetime: %lu seconds)\n", (unsigned long)link->lifetime);
link = rpl_ns_node_next(link);
}
#endif
