Fix hna-cleanup bug for empty hna lists
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Tue, 5 Jan 2010 09:47:20 +0000 (10:47 +0100)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Tue, 5 Jan 2010 09:47:20 +0000 (10:47 +0100)
src/hna_set.c

index 5a92c21..c5b1758 100644 (file)
@@ -83,7 +83,7 @@ olsr_cleanup_hna(union olsr_ip_addr *orig) {
   struct hna_entry *hna;
 
   OLSR_FOR_ALL_HNA_ENTRIES(hna) {
-    if (ipequal(&hna->A_gateway_addr, orig)) {
+    if (hna->networks.next != &hna->networks && ipequal(&hna->A_gateway_addr, orig)) {
       while (!olsr_delete_hna_net_entry(hna->networks.next));
     }
   } OLSR_FOR_ALL_HNA_ENTRIES_END(hna)