diff options
| author | Russ White <russ@riw.us> | 2025-02-13 11:16:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-13 11:16:42 -0500 |
| commit | fbff0436d337cf525abe33c389ac36939cf5afdd (patch) | |
| tree | a0c7f26824fc0221f8c6813ecb456e588a3de920 /ospfd/ospf_te.c | |
| parent | f70530c8e8ada9fcc7fd6a83e7a1e211b11b2131 (diff) | |
| parent | b44258413f4b6569f8f94869b207ee655bac70ae (diff) | |
Merge pull request #18046 from LabNConsulting/aceelindem/ospf-lsa-add-delete-hook
ospfd: Replace LSDB callbacks with LSA Update/Delete hooks.
Diffstat (limited to 'ospfd/ospf_te.c')
| -rw-r--r-- | ospfd/ospf_te.c | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index d57990e1a1..b6f432b1bb 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -3015,7 +3015,7 @@ static int ospf_te_delete_opaque_lsa(struct ls_ted *ted, struct ospf_lsa *lsa) /** * Update Traffic Engineering Database Elements that correspond to the received - * OSPF LSA. If LSA age is equal to MAX_AGE, call deletion function instead. + * OSPF LSA. * * @param lsa OSPF Link State Advertisement * @@ -3037,34 +3037,18 @@ static int ospf_mpls_te_lsa_update(struct ospf_lsa *lsa) return -1; } - /* If LSA is MAX_AGE, remove corresponding Link State element */ - if (IS_LSA_MAXAGE(lsa)) { - switch (lsa->data->type) { - case OSPF_ROUTER_LSA: - rc = ospf_te_delete_router_lsa(OspfMplsTE.ted, lsa); - break; - case OSPF_OPAQUE_AREA_LSA: - case OSPF_OPAQUE_AS_LSA: - rc = ospf_te_delete_opaque_lsa(OspfMplsTE.ted, lsa); - break; - default: - rc = 0; - break; - } - } else { - /* Parse LSA to Update corresponding Link State element */ - switch (lsa->data->type) { - case OSPF_ROUTER_LSA: - rc = ospf_te_parse_router_lsa(OspfMplsTE.ted, lsa); - break; - case OSPF_OPAQUE_AREA_LSA: - case OSPF_OPAQUE_AS_LSA: - rc = ospf_te_parse_opaque_lsa(OspfMplsTE.ted, lsa); - break; - default: - rc = 0; - break; - } + /* Parse LSA to Update corresponding Link State element */ + switch (lsa->data->type) { + case OSPF_ROUTER_LSA: + rc = ospf_te_parse_router_lsa(OspfMplsTE.ted, lsa); + break; + case OSPF_OPAQUE_AREA_LSA: + case OSPF_OPAQUE_AS_LSA: + rc = ospf_te_parse_opaque_lsa(OspfMplsTE.ted, lsa); + break; + default: + rc = 0; + break; } return rc; @@ -3096,19 +3080,6 @@ static int ospf_mpls_te_lsa_delete(struct ospf_lsa *lsa) return -1; } - /* - * Process only self LSAs that reach MAX_AGE. Indeed, when the router - * need to update or refresh an LSA, it first removes the old LSA from - * the LSDB and then insert the new one. Thus, to avoid removing - * corresponding Link State element and loosing some parameters - * instead of just updating it, only self LSAs that reach MAX_AGE are - * processed here. Other LSAs are processed by ospf_mpls_te_lsa_update() - * and eventually removed when LSA age is MAX_AGE i.e. LSA is flushed - * by the originator. - */ - if (!IS_LSA_SELF(lsa) || !IS_LSA_MAXAGE(lsa)) - return 0; - /* Parse Link State information */ switch (lsa->data->type) { case OSPF_ROUTER_LSA: |
