]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Hotfix for router's parent without nexthop.
authorOndrej Filip <feela@network.cz>
Wed, 2 Jun 2004 09:14:03 +0000 (09:14 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 2 Jun 2004 09:14:03 +0000 (09:14 +0000)
It will probably work perfect, but I need to eliminate such situation.

proto/ospf/rt.c

index 652aca8cd92914bc221868fa93ec451342ef2ab6..5a826746bee349aa7d8f5b118cc0deda1451dbb2 100644 (file)
@@ -554,9 +554,12 @@ add_cand(list *l, struct top_hash_entry *en, struct top_hash_entry *par,
   DBG("     Adding candidate: rt: %I, id: %I, type: %u\n",en->lsa.rt,en->lsa.id,en->lsa.type);
 
   en->nhi=NULL;
+  en->nh=IPA_NONE;
   
   calc_next_hop(en, par, oa);
 
+  if(!en->nhi) return;         /* We cannot find next hop, ignore it */
+
   if(en->color==CANDIDATE)     /* We found a shorter path */
   {
     rem_node(&en->cn);
@@ -624,7 +627,9 @@ calc_next_hop(struct top_hash_entry *en, struct top_hash_entry *par,
               en->nhi=ifa->iface;
               return;
             }
-          bug("I didn't find interface for my self originated LSA!\n");
+          log(L_ERR "I didn't find interface for my self originated LSA!\n");
+               /* This could sometimes happen */
+          return;
         }
         else
         {
@@ -655,7 +660,9 @@ calc_next_hop(struct top_hash_entry *en, struct top_hash_entry *par,
     }
     else       /* Parent is some RT neighbor */
     {
-      bug("Router parent does not have next hop.");    /* Hope this will never happen */
+      log(L_ERR "Router's parent has no next hop. (EN=%I, PAR=%I)", en->lsa.id, par->lsa.id);
+               /* I hoped this would never happen */
+      return;
     }
   }
   en->nh=par->nh;