diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2020-11-20 04:01:55 +0100 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2020-11-30 15:36:10 +0100 |
commit | f5f26b8fcad0e36b7d8b88aeb652072eb203da22 (patch) | |
tree | e92a541150fea48197b972bd3c05b5dffd1d7679 | |
parent | ospf6: get instance from route table scope (diff) | |
download | frr-f5f26b8fcad0e36b7d8b88aeb652072eb203da22.tar.xz frr-f5f26b8fcad0e36b7d8b88aeb652072eb203da22.zip |
ospf6: get instance from lsdb data
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
-rw-r--r-- | ospf6d/ospf6_abr.h | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.c | 7 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.h | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_top.c | 5 |
4 files changed, 8 insertions, 8 deletions
diff --git a/ospf6d/ospf6_abr.h b/ospf6d/ospf6_abr.h index e261cd109..25a73f920 100644 --- a/ospf6d/ospf6_abr.h +++ b/ospf6d/ospf6_abr.h @@ -68,7 +68,7 @@ extern void ospf6_abr_originate_summary(struct ospf6_route *route, struct ospf6 *ospf6); extern void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa); -extern void ospf6_abr_defaults_to_stub(struct ospf6 *); +extern void ospf6_abr_defaults_to_stub(struct ospf6 *ospf6); extern void ospf6_abr_examin_brouter(uint32_t router_id, struct ospf6_route *route, struct ospf6 *ospf6); diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 175f87120..a9fc80252 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -442,12 +442,13 @@ void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old, } } -void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa, struct ospf6 *ospf6) +void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa) { struct ospf6_as_external_lsa *external; struct prefix asbr_id; struct ospf6_route *asbr_entry, *route, *old; struct ospf6_path *path; + struct ospf6 *ospf6; external = (struct ospf6_as_external_lsa *)OSPF6_LSA_HEADER_END( lsa->header); @@ -455,6 +456,8 @@ void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa, struct ospf6 *ospf6) if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) zlog_debug("Calculate AS-External route for %s", lsa->name); + ospf6 = ospf6_get_by_lsdb(lsa); + if (lsa->header->adv_router == ospf6->router_id) { if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) zlog_debug("Ignore self-originated AS-External-LSA"); @@ -822,7 +825,7 @@ void ospf6_asbr_lsentry_add(struct ospf6_route *asbr_entry, struct ospf6 *ospf6) router = ospf6_linkstate_prefix_adv_router(&asbr_entry->prefix); for (ALL_LSDB_TYPED_ADVRTR(ospf6->lsdb, type, router, lsa)) { if (!OSPF6_LSA_IS_MAXAGE(lsa)) - ospf6_asbr_lsa_add(lsa, ospf6); + ospf6_asbr_lsa_add(lsa); } } diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h index 46c99706a..24cc6a07b 100644 --- a/ospf6d/ospf6_asbr.h +++ b/ospf6d/ospf6_asbr.h @@ -70,7 +70,7 @@ struct ospf6_as_external_lsa { (E)->bits_metric |= htonl(0x00ffffff) & htonl(C); \ } -extern void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa, struct ospf6 *ospf6); +extern void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa); extern void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa, struct ospf6_route *asbr_entry); extern void ospf6_asbr_lsentry_add(struct ospf6_route *asbr_entry, diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 6cd214f59..97002145b 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -124,12 +124,9 @@ struct ospf6 *ospf6_lookup_by_vrf_name(const char *name) static void ospf6_top_lsdb_hook_add(struct ospf6_lsa *lsa) { - struct ospf6 *ospf6 = NULL; - switch (ntohs(lsa->header->type)) { case OSPF6_LSTYPE_AS_EXTERNAL: - ospf6 = ospf6_get_by_lsdb(lsa); - ospf6_asbr_lsa_add(lsa, ospf6); + ospf6_asbr_lsa_add(lsa); break; default: |