]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
My calculation of external routes violated rfc. :-(
authorOndrej Filip <feela@network.cz>
Wed, 16 Aug 2000 19:37:04 +0000 (19:37 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 16 Aug 2000 19:37:04 +0000 (19:37 +0000)
proto/ospf/rt.c

index 2ca1b36ec1bcd39fcb8e04fe0997219de1497dc7..f7397c16cb6d9eea421a522e9485ac2c470ae0c0 100644 (file)
@@ -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;