FIX: hanging topology edges if neighbor is lost
authorHenning Rogge <rogge@fgan.de>
Mon, 2 Feb 2009 10:25:06 +0000 (11:25 +0100)
committerHenning Rogge <rogge@fgan.de>
Mon, 2 Feb 2009 10:25:06 +0000 (11:25 +0100)
src/link_set.c
src/tc_set.c

index 1feaf01..ec307e4 100644 (file)
@@ -327,6 +327,14 @@ set_loss_link_multiplier(struct link_entry *entry)
 static void
 olsr_delete_link_entry(struct link_entry *link)
 {
+  struct tc_edge_entry *tc_edge;
+
+  /* delete tc edges we made for SPF */
+  tc_edge = olsr_lookup_tc_edge(tc_myself, &link->neighbor_iface_addr);
+  if (tc_edge != NULL) {
+    olsr_delete_tc_edge_entry(tc_edge);
+  }
+
 
   /* Delete neighbor entry */
   if (link->neighbor->linkcount == 1) {
index 8e8036f..d6dbc1f 100644 (file)
@@ -584,6 +584,8 @@ olsr_delete_revoked_tc_edges(struct tc_entry *tc, uint16_t ansn, union olsr_ip_a
   }
   OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
 
+  if (retval)
+    changes_topology = true;
   return retval;
 }
 
@@ -727,7 +729,7 @@ olsr_calculate_tc_border(uint8_t lower_border, union olsr_ip_addr *lower_border_
     return 0;
   }
   if (lower_border == 0xff) {
-    memset(&lower_border_ip, 0, sizeof(lower_border_ip));
+    memset(lower_border_ip, 0, sizeof(lower_border_ip));
   } else {
     int i;
 
@@ -740,7 +742,7 @@ olsr_calculate_tc_border(uint8_t lower_border, union olsr_ip_addr *lower_border_
   }
 
   if (upper_border == 0xff) {
-    memset(&upper_border_ip, 0xff, sizeof(upper_border_ip));
+    memset(upper_border_ip, 0xff, sizeof(upper_border_ip));
   } else {
     int i;