summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Henderson <tomh@tomh.org>2009-07-16 17:20:37 +0100
committerPaul Jakma <paul@quagga.net>2009-07-16 17:20:37 +0100
commit9b4ef258a9d9c5f1052afe0e19ebaef9f6740fa2 (patch)
tree7deb3abfbddadc9c15300c1a6702549e918db5dc
parent41b2373cece77f0cc9a06fba076c99a7be653593 (diff)
[ospf6d] Fix regression in monotonic time patch - LSA max-aging broke
* ospf6_lsa.c: (ospf6_lsa_premature_aging) set age to MAX_AGE - don't rely on 0 magically meaning same. (ospf6_lsa_age_current) handle MAXAGE.
-rw-r--r--ospf6d/ospf6_lsa.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 108c025d..34040b84 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -207,6 +207,12 @@ ospf6_lsa_age_current (struct ospf6_lsa *lsa)
zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s",
safe_strerror (errno));
+ if (lsa->header->age >= htons (MAXAGE))
+ {
+ /* LSA may have been prematurely aged */
+ lsa->header->age = htons (MAXAGE);
+ return MAXAGE;
+ }
/* calculate age */
ulage = now.tv_sec - lsa->birth.tv_sec;
@@ -239,7 +245,12 @@ ospf6_lsa_premature_aging (struct ospf6_lsa *lsa)
THREAD_OFF (lsa->expire);
THREAD_OFF (lsa->refresh);
+ /*
+ * The below technique to age out LSA does not work when using relative time
+ *
memset (&lsa->birth, 0, sizeof (struct timeval));
+ */
+ lsa->header->age = htons (MAXAGE);
thread_execute (master, ospf6_lsa_expire, lsa, 0);
}