summaryrefslogtreecommitdiff
path: root/ospfd/ospf_opaque.c
diff options
context:
space:
mode:
authorAcee <aceelindem@gmail.com>2023-05-09 16:51:03 -0400
committerAcee <aceelindem@gmail.com>2023-05-09 16:51:03 -0400
commit4e7eb1e62ce54ebcf78622682de962fdeff20b80 (patch)
treec0d46c7f21ee5a3fee4445ad90ee30ce75960173 /ospfd/ospf_opaque.c
parent8110a8e1e715a34b8ad8671a3e58baab3fe71782 (diff)
ospfd: OSPF opaque LSA stale processing fix and topotests.
1. Fix OSPF opaque LSA processing to preserve the stale opaque LSAs in the Link State Database for 60 seconds consistent with what is done for other LSA types. 2. Add a topotest that tests for cases where ospfd is restarted and a stale OSPF opaque LSA exists in the OSPF routing domain both when the LSA is purged and when the LSA is reoriginagted with a more recent instance. Signed-off-by: Acee <aceelindem@gmail.com>
Diffstat (limited to 'ospfd/ospf_opaque.c')
-rw-r--r--ospfd/ospf_opaque.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index c2b40af1c4..6894c6a009 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -2120,14 +2120,21 @@ void ospf_opaque_self_originated_lsa_received(struct ospf_neighbor *nbr,
lsa->data->type, &lsa->data->id);
/*
- * Since these LSA entries are not yet installed into corresponding
- * LSDB, just flush them without calling ospf_ls_maxage() afterward.
+ * Install the stale LSA into the Link State Database, add it to the
+ * MaxAge list, and flush it from the OSPF routing domain. For other
+ * LSA types, the installation is done in the refresh function. It is
+ * done inline here since the opaque refresh function is dynamically
+ * registered when opaque LSAs are originated (which is not the case
+ * for stale LSAs).
*/
lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
+ ospf_lsa_install(
+ top, (lsa->data->type == OSPF_OPAQUE_LINK_LSA) ? nbr->oi : NULL,
+ lsa);
+ ospf_lsa_maxage(top, lsa);
+
switch (lsa->data->type) {
case OSPF_OPAQUE_LINK_LSA:
- ospf_flood_through_area(nbr->oi->area, NULL /*inbr*/, lsa);
- break;
case OSPF_OPAQUE_AREA_LSA:
ospf_flood_through_area(nbr->oi->area, NULL /*inbr*/, lsa);
break;
@@ -2139,7 +2146,6 @@ void ospf_opaque_self_originated_lsa_received(struct ospf_neighbor *nbr,
__func__, lsa->data->type);
return;
}
- ospf_lsa_discard(lsa); /* List "lsas" will be deleted by caller. */
}
/*------------------------------------------------------------------------*