summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-08-16 21:37:04 +0200
committerOndrej Filip <feela@network.cz>2000-08-16 21:37:04 +0200
commit059fc1e94abcd658e9340313ffd080c5829ba8ef (patch)
tree2a61fa70c5a483d0d849ef12a87d680e7fc684e3 /proto
parentd6a7e2fb8590660c00e984ff41d2e668d2ead69b (diff)
downloadbird-059fc1e94abcd658e9340313ffd080c5829ba8ef.tar
bird-059fc1e94abcd658e9340313ffd080c5829ba8ef.zip
My calculation of external routes violated rfc. :-(
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/rt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 2ca1b36..f7397c1 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -399,7 +399,9 @@ ospf_ext_spfa(struct proto_ospf *po) /* FIXME looking into inter-area */
}
nf=fib_get(ef,&ip, mlen);
- if((nf->metric>met) || ((nf->metric==met)&&(nf->metric2>met2)))
+ if(((nf->metric>met)&&(nf->metric2==met2)) || /* both E1 or E2 with same metric */
+ ((nf->metric2>met2)&&(nf->metric2!=LSINFINITY)) || /* E2 smaller and 1st is not E1 */
+ ((nf->metric2==LSINFINITY)&&(met2!=LSINFINITY))) /* 2nd is E1 and 1st is E2 */
{
nf->metric=met;
nf->metric2=met2;