Delete routes in the correct order.
authorThomas Lopatic <thomas@lopatic.de>
Mon, 14 Feb 2005 18:25:03 +0000 (18:25 +0000)
committerThomas Lopatic <thomas@lopatic.de>
Mon, 14 Feb 2005 18:25:03 +0000 (18:25 +0000)
src/process_routes.c
src/win32/kernel_routes.c

index 4b0c4a5..2fe2128 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: process_routes.c,v 1.19 2005/02/03 17:31:39 kattemat Exp $
+ * $Id: process_routes.c,v 1.20 2005/02/14 18:25:03 tlopatic Exp $
  */
 
 
@@ -318,10 +318,9 @@ olsr_delete_routes_from_kernel(struct destination_n *delete_kernel_list)
        {
 
          if((destination_ptr->destination->rt_metric == metric_counter) &&
-            ((last_run && 
-              COMP_IP(&destination_ptr->destination->rt_dst, 
-                      &destination_ptr->destination->rt_router)) 
-             || !last_run))
+            ((last_run || 
+              !COMP_IP(&destination_ptr->destination->rt_dst, 
+                        &destination_ptr->destination->rt_router))))
            {
              olsr_16_t error;
 #ifdef DEBUG
@@ -396,8 +395,9 @@ olsr_add_routes_in_kernel(struct destination_n *add_kernel_list)
       for(destination_kernel = add_kernel_list; destination_kernel != NULL; )
        {
          if((destination_kernel->destination->rt_metric == metric_counter) &&
-            ((first_run && 
-              COMP_IP(&destination_kernel->destination->rt_dst, &destination_kernel->destination->rt_router)) || !first_run))
+            (!first_run || 
+              COMP_IP(&destination_kernel->destination->rt_dst,
+                      &destination_kernel->destination->rt_router)))
            {
              olsr_16_t error;
              /* First add all 1-hop routes that has themselves as GW */
index 305945b..2e73583 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: kernel_routes.c,v 1.13 2005/02/14 15:54:30 tlopatic Exp $
+ * $Id: kernel_routes.c,v 1.14 2005/02/14 18:25:03 tlopatic Exp $
  */
 
 #include <stdio.h>
@@ -62,8 +62,8 @@ int olsr_ioctl_add_route(struct rt_entry *Dest)
   inet_ntop(AF_INET, &Dest->rt_mask.v4, Str2, 16);
   inet_ntop(AF_INET, &Dest->rt_router.v4, Str3, 16);
 
-  olsr_printf(1, "Adding IPv4 route to %s/%s via %s and I/F 0x%x.\n",
-              Str1, Str2, Str3, Dest->rt_if->if_index);
+  olsr_printf(1, "Adding IPv4 route with metric %d to %s/%s via %s and I/F 0x%x.\n",
+              Dest->rt_metric, Str1, Str2, Str3, Dest->rt_if->if_index);
 
   memset(&Row, 0, sizeof (MIB_IPFORWARDROW));
 
@@ -118,8 +118,8 @@ int olsr_ioctl_del_route(struct rt_entry *Dest)
   inet_ntop(AF_INET, &Dest->rt_mask.v4, Str2, 16);
   inet_ntop(AF_INET, &Dest->rt_router.v4, Str3, 16);
 
-  olsr_printf(1, "Deleting IPv4 route to %s/%s via %s and I/F 0x%x.\n",
-              Str1, Str2, Str3, Dest->rt_if->if_index);
+  olsr_printf(1, "Deleting IPv4 route with metric %d to %s/%s via %s and I/F 0x%x.\n",
+              Dest->rt_metric, Str1, Str2, Str3, Dest->rt_if->if_index);
 
   memset(&Row, 0, sizeof (MIB_IPFORWARDROW));