summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
authorTom Henderson <tomh@tomh.org>2009-08-28 15:10:00 +0100
committerPaul Jakma <paul@quagga.net>2009-08-28 15:10:00 +0100
commitaabbb1ae358a3fd9af011cddc1a67dfa0b3df2d2 (patch)
tree04ce8d205c0242f93037873f92e8a6f8dc24927a /ospf6d
parentd1c21cabdbeeb4d12049f39579c602686eb94927 (diff)
ospf6d: bug #529, fix endianness problem in earlier commit
* ospf6_lsa.c: (ospf6_lsa_age_current) arithmetical compares make no sense in non-host order..
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_lsa.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 34040b84..07d9f91e 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -207,9 +207,11 @@ 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))
+ if (ntohs (lsa->header->age) >= MAXAGE)
{
- /* LSA may have been prematurely aged */
+ /* ospf6_lsa_premature_aging () sets age to MAXAGE; when using
+ relative time, we cannot compare against lsa birth time, so
+ we catch this special case here. */
lsa->header->age = htons (MAXAGE);
return MAXAGE;
}
@@ -245,11 +247,6 @@ 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);
}