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" \
