summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2005-02-18 18:51:42 +0000
committerOndrej Filip <feela@network.cz>2005-02-18 18:51:42 +0000
commit60e04f041303fdafd0abf0dec003a9745345c68a (patch)
tree4d05e0042b8b2289e790b7750ddb22284ca8ad9b /proto/ospf/rt.c
parent27a1e3ac35bd3f6a9b5161eafb5b8178162a37f8 (diff)
Minor bugfix: Summary LSA for aggregated area was always propagated with
metric = 1. Now it's metric of most distant component.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 7f7f4635..b3de8bfd 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -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;