Index: src/process_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v retrieving revision 1.24 diff -C5 -r1.24 process_routes.c *** src/process_routes.c 28 Feb 2005 14:42:57 -0000 1.24 --- src/process_routes.c 19 May 2005 08:44:05 -0000 *************** *** 296,323 **** { struct destination_n *destination_ptr; int metric_counter = 1; olsr_bool last_run = OLSR_FALSE; /* Find highest metric */ for(destination_ptr = delete_kernel_list; destination_ptr != NULL; destination_ptr = destination_ptr->next) { if(destination_ptr->destination->rt_metric > metric_counter) metric_counter = destination_ptr->destination->rt_metric; } #ifdef DEBUG OLSR_PRINTF(3, "%s highest metric %d\n", __func__, metric_counter) #endif while(delete_kernel_list!=NULL) { struct destination_n *previous_node = delete_kernel_list; ! assert(metric_counter); /* searching for all the items with metric equal to n */ for(destination_ptr = delete_kernel_list; destination_ptr != NULL; ) { --- 296,345 ---- { struct destination_n *destination_ptr; int metric_counter = 1; olsr_bool last_run = OLSR_FALSE; + printf("olsr_delete_routes_from_kernel, metrics:\n"); /* Find highest metric */ for(destination_ptr = delete_kernel_list; destination_ptr != NULL; destination_ptr = destination_ptr->next) { if(destination_ptr->destination->rt_metric > metric_counter) metric_counter = destination_ptr->destination->rt_metric; + printf("\t%s : %d\n", olsr_ip_to_string(&destination_ptr->destination->rt_dst), + destination_ptr->destination->rt_metric); } + printf("\nhighest metric %d\n", metric_counter); + #ifdef DEBUG OLSR_PRINTF(3, "%s highest metric %d\n", __func__, metric_counter) #endif while(delete_kernel_list!=NULL) { struct destination_n *previous_node = delete_kernel_list; ! if(metric_counter == 0) ! { ! struct destination_n *tmp_node = delete_kernel_list; ! ! printf("Stale route(s) detected in %s!\n", __func__); ! ! while(tmp_node) ! { ! printf("Stale route to to %s via %s by %s hopcount %d!\n", ! olsr_ip_to_string(&destination_ptr->destination->rt_dst), ! olsr_ip_to_string(&destination_ptr->destination->rt_router), ! destination_ptr->destination->rt_if->int_name, ! destination_ptr->destination->rt_metric); ! tmp_node = tmp_node->next; ! } ! ! assert(0); ! } /* searching for all the items with metric equal to n */ for(destination_ptr = delete_kernel_list; destination_ptr != NULL; ) { *************** *** 325,334 **** --- 347,363 ---- ((last_run || !COMP_IP(&destination_ptr->destination->rt_dst, &destination_ptr->destination->rt_router)))) { olsr_16_t error; + + printf("Deleting route to to %s via %s by %s hopcount %d!\n", + olsr_ip_to_string(&destination_ptr->destination->rt_dst), + olsr_ip_to_string(&destination_ptr->destination->rt_router), + destination_ptr->destination->rt_if->int_name, + destination_ptr->destination->rt_metric); + #ifdef DEBUG OLSR_PRINTF(3, "Deleting route to %s hopcount %d\n", olsr_ip_to_string(&destination_ptr->destination->rt_dst), destination_ptr->destination->rt_metric) #endif