]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Remove another odd flooding hack in opaque LSA code
authorPaul Jakma <paul@opensourcerouting.org>
Fri, 23 Jan 2015 16:43:49 +0000 (16:43 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 8 Jun 2016 19:03:49 +0000 (15:03 -0400)
* 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
ospfd/ospf_opaque.c
ospfd/ospf_opaque.h
ospfd/ospf_packet.c

index c8208a1fa6ef76e4cea44f1c1207543754849efd..4c05c772522b907220095e37bcb91a232ab31f9f 100644 (file)
@@ -2115,114 +2115,6 @@ out:
   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)
index 077da62747eac515895fda3f4c1104bb962475be..b9490a0ff2aea764e38047d6823332f9ce4199f7 100644 (file)
@@ -134,8 +134,6 @@ extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
 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);
index eeed11be9d853d8c6e821bf3a418733638320e78..4b9f1c651a5a7b8968fc32f572cb86a223c289f8 100644 (file)
@@ -1779,21 +1779,6 @@ ospf_ls_upd (struct ospf *ospf, struct ip *iph, struct ospf_header *ospfh,
    */
   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" \