ospfd: Remove another odd flooding hack in opaque LSA code
* ospf_opaque.c: (ospf_opaque_adjust_lsreq) Odd hack to general OSPF
database exchange but made to act only on opaque LSAs. It's either covering
up bugs in the flooding code or its wrong. If it's covering up bugs, those
would affect all LSAs and should be fixed at a lower layer in ospfd, indeed
perhaps those bugs are long fixed anyway (?). Alternatively, it's just plain
wrong. Nuke.
(ospf_opaque_exclude_lsa_from_lsreq) helper to above, nuke.
* ospf_packet.c: Nuke call to ospf_opaque_adjust_lsreq.
Tested-by: olivier.dugeon@orange.com
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index d449c95..f584fc7 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -2109,114 +2109,6 @@
return;
}
-/*------------------------------------------------------------------------*
- * Followings are control functions to block origination after restart.
- *------------------------------------------------------------------------*/
-
-static void ospf_opaque_exclude_lsa_from_lsreq (struct route_table *nbrs, struct ospf_neighbor *inbr, struct ospf_lsa *lsa);
-
-void
-ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr, struct list *lsas)
-{
- struct ospf *top;
- struct ospf_area *area;
- struct ospf_interface *oi;
- struct listnode *node1, *nnode1;
- struct listnode *node2, *nnode2;
- struct ospf_lsa *lsa;
-
- if ((top = oi_to_top (nbr->oi)) == NULL)
- goto out;
-
- /*
- * If an instance of self-originated Opaque-LSA is found in the given
- * LSA list, and it is not installed to LSDB yet, exclude it from the
- * list "nbr->ls_req". In this way, it is assured that an LSReq message,
- * which might be sent in the process of flooding, will not request for
- * the LSA to be flushed immediately; otherwise, depending on timing,
- * an LSUpd message will carry instances of target LSAs with MaxAge,
- * while other LSUpd message might carry old LSA instances (non-MaxAge).
- * Obviously, the latter would trigger miserable situations that repeat
- * installation and removal of unwanted LSAs indefinitely.
- */
- for (ALL_LIST_ELEMENTS (lsas, node1, nnode1, lsa))
- {
- /* Filter out unwanted LSAs. */
- if (! IS_OPAQUE_LSA (lsa->data->type))
- continue;
- if (! IPV4_ADDR_SAME (&lsa->data->adv_router, &top->router_id))
- continue;
-
- /*
- * Don't touch an LSA which has MaxAge; two possible cases.
- *
- * 1) This LSA has originally flushed by myself (received LSUpd
- * message's router-id is equal to my router-id), and flooded
- * back by an opaque-capable router.
- *
- * 2) This LSA has expired in an opaque-capable router and thus
- * flushed by the router.
- */
- if (IS_LSA_MAXAGE (lsa))
- continue;
-
- /* If the LSA has installed in the LSDB, nothing to do here. */
- if (ospf_lsa_lookup_by_header (nbr->oi->area, lsa->data) != NULL)
- continue;
-
- /* Ok, here we go. */
- switch (lsa->data->type)
- {
- case OSPF_OPAQUE_LINK_LSA:
- oi = nbr->oi;
- ospf_opaque_exclude_lsa_from_lsreq (oi->nbrs, nbr, lsa);
- break;
- case OSPF_OPAQUE_AREA_LSA:
- area = nbr->oi->area;
- for (ALL_LIST_ELEMENTS (area->oiflist, node2, nnode2, oi))
- ospf_opaque_exclude_lsa_from_lsreq (oi->nbrs, nbr, lsa);
- break;
- case OSPF_OPAQUE_AS_LSA:
- for (ALL_LIST_ELEMENTS (top->oiflist, node2, nnode2, oi))
- ospf_opaque_exclude_lsa_from_lsreq (oi->nbrs, nbr, lsa);
- break;
- default:
- break;
- }
- }
-
-out:
- return;
-}
-
-static void
-ospf_opaque_exclude_lsa_from_lsreq (struct route_table *nbrs,
- struct ospf_neighbor *inbr,
- struct ospf_lsa *lsa)
-{
- struct route_node *rn;
- struct ospf_neighbor *onbr;
- struct ospf_lsa *ls_req;
-
- for (rn = route_top (nbrs); rn; rn = route_next (rn))
- {
- if ((onbr = rn->info) == NULL)
- continue;
- if (onbr == inbr)
- continue;
- if ((ls_req = ospf_ls_request_lookup (onbr, lsa)) == NULL)
- continue;
-
- if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("LSA[%s]: Exclude this entry from LSReq to send.", dump_lsa_key (lsa));
-
- ospf_ls_request_delete (onbr, ls_req);
-/* ospf_check_nbr_loading (onbr);*//* XXX */
- }
-
- return;
-}
-
void
ospf_opaque_self_originated_lsa_received (struct ospf_neighbor *nbr,
struct ospf_lsa *lsa)
diff --git a/ospfd/ospf_opaque.h b/ospfd/ospf_opaque.h
index 077da62..b9490a0 100644
--- a/ospfd/ospf_opaque.h
+++ b/ospfd/ospf_opaque.h
@@ -134,8 +134,6 @@
extern void ospf_opaque_lsa_refresh_schedule (struct ospf_lsa *lsa);
extern void ospf_opaque_lsa_flush_schedule (struct ospf_lsa *lsa);
-extern void ospf_opaque_adjust_lsreq (struct ospf_neighbor *nbr,
- struct list *lsas);
extern void ospf_opaque_self_originated_lsa_received (struct ospf_neighbor
*nbr,
struct ospf_lsa *lsa);
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index d597653..587484f 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1745,21 +1745,6 @@
*/
lsas = ospf_ls_upd_list_lsa (nbr, s, oi, size);
-#ifdef HAVE_OPAQUE_LSA
- /*
- * If self-originated Opaque-LSAs that have flooded before restart
- * are contained in the received LSUpd message, corresponding LSReq
- * messages to be sent may have to be modified.
- * To eliminate possible race conditions such that flushing and normal
- * updating for the same LSA would take place alternately, this trick
- * must be done before entering to the loop below.
- */
- /* XXX: Why is this Opaque specific? Either our core code is deficient
- * and this should be fixed generally, or Opaque is inventing strawman
- * problems */
- ospf_opaque_adjust_lsreq (nbr, lsas);
-#endif /* HAVE_OPAQUE_LSA */
-
#define DISCARD_LSA(L,N) {\
if (IS_DEBUG_OSPF_EVENT) \
zlog_debug ("ospf_lsa_discard() in ospf_ls_upd() point %d: lsa %p" \