fixed a timer NULL pointer.
authorBernd Petrovitsch <bernd@firmix.at>
Fri, 14 Nov 2008 00:48:35 +0000 (01:48 +0100)
committerBernd Petrovitsch <bernd@firmix.at>
Fri, 14 Nov 2008 00:48:35 +0000 (01:48 +0100)
Please review if this fix is correct.

src/process_package.c

index fa7fedc..0190d7f 100644 (file)
@@ -249,11 +249,10 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
 static void
 linking_this_2_entries(struct neighbor_entry *neighbor, struct neighbor_2_entry *two_hop_neighbor, olsr_reltime vtime)
 {
-  struct neighbor_list_entry    *list_of_1_neighbors = olsr_malloc(sizeof(*list_of_1_neighbors), "Link entries 1");
-  struct neighbor_2_list_entry  *list_of_2_neighbors = olsr_malloc(sizeof(*list_of_2_neighbors), "Link entries 2");
+  struct neighbor_list_entry   *list_of_1_neighbors = olsr_malloc(sizeof(*list_of_1_neighbors), "Link entries 1");
+  struct neighbor_2_list_entry *list_of_2_neighbors = olsr_malloc(sizeof(*list_of_2_neighbors), "Link entries 2");
 
   list_of_1_neighbors->neighbor = neighbor;
-
   list_of_1_neighbors->path_linkcost = LINK_COST_BROKEN;
   list_of_1_neighbors->saved_path_linkcost = LINK_COST_BROKEN;
   list_of_1_neighbors->second_hop_linkcost = LINK_COST_BROKEN;
@@ -261,14 +260,15 @@ linking_this_2_entries(struct neighbor_entry *neighbor, struct neighbor_2_entry
   /* Queue */
   two_hop_neighbor->neighbor_2_nblist.next->prev = list_of_1_neighbors;
   list_of_1_neighbors->next = two_hop_neighbor->neighbor_2_nblist.next;
-
   two_hop_neighbor->neighbor_2_nblist.next = list_of_1_neighbors;
   list_of_1_neighbors->prev = &two_hop_neighbor->neighbor_2_nblist;
+
   list_of_2_neighbors->neighbor_2 = two_hop_neighbor;
   list_of_2_neighbors->nbr2_nbr = neighbor; /* XXX refcount */
-
-  olsr_change_timer(list_of_2_neighbors->nbr2_list_timer, vtime,
-                    OLSR_NBR2_LIST_JITTER, OLSR_TIMER_ONESHOT);
+  list_of_2_neighbors->nbr2_list_timer =
+    olsr_start_timer(vtime, OLSR_NBR2_LIST_JITTER,
+                    OLSR_TIMER_ONESHOT, &olsr_expire_nbr2_list,
+                    list_of_2_neighbors, nbr2_list_timer_cookie->ci_id);
 
   /* Queue */
   neighbor->neighbor_2_list.next->prev = list_of_2_neighbors;