diff options
author | Ondrej Filip <feela@network.cz> | 2004-06-02 11:14:03 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-06-02 11:14:03 +0200 |
commit | 9b133458891724da2fd22f2a16ae19376e225ca0 (patch) | |
tree | 8e2ff68df7f45617b15c208506b6e204a127eb90 /proto | |
parent | f9625e9acabbdc5834f528e6fe1b87b8f4ce4968 (diff) | |
download | bird-9b133458891724da2fd22f2a16ae19376e225ca0.tar bird-9b133458891724da2fd22f2a16ae19376e225ca0.zip |
Hotfix for router's parent without nexthop.
It will probably work perfect, but I need to eliminate such situation.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/ospf/rt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 652aca8..5a82674 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -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; |