ospfd: Fix maxage/flush to not try flood twice, remember maxages for longer

2006-05-30 Paul Jakma <paul.jakma@sun.com>

	* (general) Fix confusion around MaxAge-ing and problem with
	  high-latency networks. Analysis and suggested fixes by
	  Phillip Spagnolo, in [quagga-dev 4132], on which this commit
	  expands slightly.
	* ospf_flood.{c,h}: (ospf_lsa_flush) new function.
	  Scope-general form of existing flush functions, essentially
	  the dormant ospf_maxage_flood() but without the ambiguity of
	  whether it is responsible for flooding.
	* ospf_lsa.c: (ospf_lsa_maxage) Role minimised to simply setup
	  LSA on the Maxage list and schedule removal - no more.
	  ospf_lsa_flush* being the primary way to kick-off flushes
	  of LSAs.
	  Don't hardcode the remover-timer value, which was too
	  short for very high-latency networks.
	  (ospf_maxage_lsa_remover) Just do what needs to be done to
	  remove maxage LSAs from the maxage list, remove the call
	  to ospf_flood_through().
	  Don't hardcode remove-timer value.
	  (ospf_lsa_{install,flush_schedule}) ospf_lsa_flush is the correct
	  entrypoint to flushing maxaged LSAs.
	  (lsa_header_set) Use a define for the initial age, useful for
	  testing.
	* ospf_opaque.c: (ospf_opaque_lsa_refresh) ditto.
	  (ospf_opaque_lsa_flush_schedule) ditto.
	* ospfd.h: ({struct ospf,ospf_new}) Add maxage_delay parameter,
	  interval to wait before running the maxage_remover. Supply a
	  suitable default.
	  Add a define for OSPF_LSA_INITIAL_AGE, see lsa_header_set().
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 0b6ac4c..6e90011 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -1630,7 +1630,7 @@
         zlog_debug ("LSA[Type%d:%s]: Flush stray Opaque-LSA", lsa->data->type, inet_ntoa (lsa->data->id));
 
       lsa->data->ls_age = htons (OSPF_LSA_MAXAGE);
-      ospf_lsa_maxage (ospf, lsa);
+      ospf_lsa_flush (ospf, lsa);
     }
   else
     (* functab->lsa_refresher)(lsa);
@@ -2108,7 +2108,7 @@
     zlog_debug ("Schedule Type-%u Opaque-LSA to FLUSH: [opaque-type=%u, opaque-id=%x]", lsa->data->type, GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)), GET_OPAQUE_ID (ntohl (lsa->data->id.s_addr)));
 
   /* This lsa will be flushed and removed eventually. */
-  ospf_lsa_maxage (lsa0->area->ospf, lsa);
+  ospf_lsa_flush (lsa0->area->ospf, lsa);
 
 out:
   return;