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)
*/
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" \