summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_spf.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-08-25 22:51:12 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2017-10-03 18:15:19 +0200
commitb5a8894de6454e1dc0b75e1d676c5ed0fcf3438b (patch)
tree8da7790f9c160dc34874e260a910f0886b24e79c /ospfd/ospf_spf.c
parentMerge pull request #1278 from chiragshah6/ospf_vrf_dev (diff)
downloadfrr-b5a8894de6454e1dc0b75e1d676c5ed0fcf3438b.tar.xz
frr-b5a8894de6454e1dc0b75e1d676c5ed0fcf3438b.zip
ospfd: OSPFv2 VRF Support
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r--ospfd/ospf_spf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 891088ecc..5e5742608 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -781,7 +781,8 @@ static unsigned int ospf_nexthop_calculation(struct ospf_area *area,
* of candidates with any vertices not already on the list. If a lower-cost
* path is found to a vertex already on the candidate list, store the new cost.
*/
-static void ospf_spf_next(struct vertex *v, struct ospf_area *area,
+static void ospf_spf_next(struct vertex *v, struct ospf *ospf,
+ struct ospf_area *area,
struct pqueue *candidate)
{
struct ospf_lsa *w_lsa = NULL;
@@ -841,7 +842,8 @@ static void ospf_spf_next(struct vertex *v, struct ospf_area *area,
inet_ntoa(l->link_id));
}
- w_lsa = ospf_lsa_lookup(area, OSPF_ROUTER_LSA,
+ w_lsa = ospf_lsa_lookup(ospf, area,
+ OSPF_ROUTER_LSA,
l->link_id, l->link_id);
if (w_lsa) {
if (IS_DEBUG_OSPF_EVENT)
@@ -1159,7 +1161,7 @@ ospf_rtrs_print (struct route_table *rtrs)
#endif
/* Calculating the shortest-path tree for an area. */
-static void ospf_spf_calculate(struct ospf_area *area,
+static void ospf_spf_calculate(struct ospf *ospf, struct ospf_area *area,
struct route_table *new_table,
struct route_table *new_rtrs)
{
@@ -1209,7 +1211,7 @@ static void ospf_spf_calculate(struct ospf_area *area,
for (;;) {
/* RFC2328 16.1. (2). */
- ospf_spf_next(v, area, candidate);
+ ospf_spf_next(v, ospf, area, candidate);
/* RFC2328 16.1. (3). */
/* If at this step the candidate list is empty, the shortest-
@@ -1307,13 +1309,13 @@ static int ospf_spf_calculate_timer(struct thread *thread)
if (ospf->backbone && ospf->backbone == area)
continue;
- ospf_spf_calculate(area, new_table, new_rtrs);
+ ospf_spf_calculate(ospf, area, new_table, new_rtrs);
areas_processed++;
}
/* SPF for backbone, if required */
if (ospf->backbone) {
- ospf_spf_calculate(ospf->backbone, new_table, new_rtrs);
+ ospf_spf_calculate(ospf, ospf->backbone, new_table, new_rtrs);
areas_processed++;
}
@@ -1339,6 +1341,12 @@ static int ospf_spf_calculate_timer(struct thread *thread)
ospf_ase_calculate_timer_add(ospf);
+
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("%s: ospf install new route, vrf %s id %u new_table count %lu",
+ __PRETTY_FUNCTION__,
+ ospf_vrf_id_to_name(ospf->vrf_id),
+ ospf->vrf_id, new_table->count);
/* Update routing table. */
monotime(&start_time);
ospf_route_install(ospf, new_table);