summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-09 00:03:29 +0200
committerOndrej Filip <feela@network.cz>2000-05-09 00:03:29 +0200
commitb57a45b81a74c091bbc71966a7c6aacebaf34e57 (patch)
tree7428778b2fb6756ffbbe363563deeb7d049905e1 /proto/ospf
parent158b99c912ef5c5cef22fd3e343341cbb52eb105 (diff)
downloadbird-b57a45b81a74c091bbc71966a7c6aacebaf34e57.tar
bird-b57a45b81a74c091bbc71966a7c6aacebaf34e57.zip
Next hop calculation improved. (I ignored stub networks advertised by my
neighbors.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/rt.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 7c7d46e..6ec70e1 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -29,6 +29,7 @@ ospf_rt_spfa(struct ospf_area *oa)
bird_clock_t delta;
int age=0,flush=0;
struct proto *p=&oa->po->proto;
+ struct proto_ospf *po=oa->po;
ip_addr ip;
struct fib_iterator fit;
struct ospf_lsa_net *ln;
@@ -45,6 +46,7 @@ ospf_rt_spfa(struct ospf_area *oa)
{
en->color=OUTSPF;
en->dist=LSINFINITY;
+ en->nhi=NULL;
if(age) ospf_age(en,delta,flush,oa);
}
@@ -184,7 +186,22 @@ again:
else
{
/* Update routing table */
- if(nf->en->nhi!=NULL)
+ if(nf->en->nhi==NULL)
+ {
+ struct top_hash_entry *en=nf->en;
+ struct ospf_neighbor *neigh;
+ neighbor *nn;
+
+ if((neigh=find_neigh_noifa(po,en->lsa.rt))==NULL)
+ {
+ goto skip;
+ }
+ nn=neigh_find(p,&neigh->ip,0);
+ DBG(" Next hop calculated: %I\n", nn->addr);
+ en->nh=nn->addr;
+ en->nhi=nn->iface;
+ }
+
{
net *ne;
rta a0;
@@ -219,6 +236,7 @@ again:
}
}
+skip:
FIB_ITERATE_END(nftmp);
}