]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: bug #529, fix endianness problem in earlier commit
authorTom Henderson <tomh@tomh.org>
Fri, 28 Aug 2009 14:10:00 +0000 (15:10 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 28 Aug 2009 14:10:00 +0000 (15:10 +0100)
* ospf6_lsa.c: (ospf6_lsa_age_current) arithmetical compares make no sense
  in non-host order..

ospf6d/ospf6_lsa.c

index 34040b84b4341520871a678f6a3e8b7d3ac924e6..07d9f91eb6336422528910d28f9fef10a69d810d 100644 (file)
@@ -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);
 }