]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor bugfix: Summary LSA for aggregated area was always propagated with
authorOndrej Filip <feela@network.cz>
Fri, 18 Feb 2005 18:51:42 +0000 (18:51 +0000)
committerOndrej Filip <feela@network.cz>
Fri, 18 Feb 2005 18:51:42 +0000 (18:51 +0000)
metric = 1. Now it's metric of most distant component.

proto/ospf/ospf.h
proto/ospf/rt.c
proto/ospf/rt.h

index 352cd766beaffbf3a3b66b95def96716ace2c337..44ba10f01c8d10306f68291d209ed2e2d9acfe70 100644 (file)
@@ -83,6 +83,7 @@ struct area_net
   struct fib_node fn;
   int hidden;
   int active;
+  u32 metric;
 };
 
 struct ospf_area_config
index 7f7f4635a096f3d828d7f4980cf65e395dc57ea7..b3de8bfde95e645a309e61350bf1149b6f0a87a6 100644 (file)
@@ -119,7 +119,10 @@ ri_install(struct proto_ospf *po, ip_addr prefix, int pxlen, int dest,
       old->efn = ipath;
     }
     if ((new->type == RTS_OSPF) && (anet = (struct area_net *)fib_route(&oa->net_fib, prefix, pxlen)))
+    {
        anet->active = 1;
+       if (new->metric1 < anet->metric) anet->metric = new->metric1;
+    }
   }
   else
   {
@@ -585,6 +588,7 @@ ospf_rt_spf(struct proto_ospf *po)
     {
       anet = (struct area_net *) nftmp;
       anet->active = 0;
+      anet->metric = LSINFINITY;
     }
     FIB_WALK_END;
     ospf_rt_spfa(oa);
@@ -1046,7 +1050,7 @@ again2:
        if ((oa == po->backbone) && oaa->trcap) fl = 1;
 
         if(fl) flush_sum_lsa(oaa, &anet->fn, ORT_NET);
-        else originate_sum_lsa(oaa, &anet->fn, ORT_NET, 1);
+        else originate_sum_lsa(oaa, &anet->fn, ORT_NET, anet->metric);
       }
     }
     FIB_WALK_END;
index ea2f28f5913f28c90d0c67e7176496afbc17cef4..acb0a1ac88361c6c0feb95691186b7b6052e8278 100644 (file)
@@ -21,8 +21,8 @@ typedef struct orta
 #define ORTA_ASBR 1
 #define ORTA_ABR 2
   struct ospf_area *oa;
-  int metric1;
-  int metric2;
+  u32 metric1;
+  u32 metric2;
   ip_addr nh;                  /* Next hop */
   struct ospf_iface *ifa;      /* Outgoing interface */
   struct top_hash_entry *ar;   /* Advertising router */