]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2004-05-31 Sagun Shakya <sagun.shakya@sun.com>
authorpaul <paul>
Mon, 31 May 2004 14:16:54 +0000 (14:16 +0000)
committerpaul <paul>
Mon, 31 May 2004 14:16:54 +0000 (14:16 +0000)
        * ospf_dump.c: (ospf_lsa_header_dump) LOOKUP can return null if
          index is out of range.
          ospf_flood.c: endianness fix
          ospf_lsa.c: Missing ntohl's on (struct lsa *)->data->ls_seqnum
          in various places.

ospfd/ChangeLog
ospfd/ospf_dump.c
ospfd/ospf_flood.c
ospfd/ospf_lsa.c

index fa901ced84ab08a61906737a0f08fb851628328a..5c4a670258361fcb3fb17ec68f591e79227f79be 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-31 Sagun Shakya <sagun.shakya@sun.com>
+
+       * ospf_dump.c: (ospf_lsa_header_dump) LOOKUP can return null if
+         index is out of range.
+         ospf_flood.c: endianness fix
+         ospf_lsa.c: Missing ntohl's on (struct lsa *)->data->ls_seqnum
+         in various places.
+         
 2004-05-10 Hasso Tepper <hasso@estpak.ee>
 
        * ospf_zebra.c, ospfd.c: Move ospf_prefix_list_update() function
index fe75a960d6c904862be8e97db81e18d730e9b386..ccee1d6ba20f0ec09ebd2beaf381dece96f8df94 100644 (file)
@@ -325,12 +325,14 @@ ospf_dd_flags_dump (u_char flags, char *buf, size_t size)
 void
 ospf_lsa_header_dump (struct lsa_header *lsah)
 {
+  char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
+  
   zlog_info ("  LSA Header");
   zlog_info ("    LS age %d", ntohs (lsah->ls_age));
   zlog_info ("    Options %d (%s)", lsah->options,
             ospf_options_dump (lsah->options));
   zlog_info ("    LS type %d (%s)", lsah->type,
-            LOOKUP (ospf_lsa_type_msg, lsah->type));
+             (lsah->type ? lsah->type : "unknown type"));
   zlog_info ("    Link State ID %s", inet_ntoa (lsah->id));
   zlog_info ("    Advertising Router %s", inet_ntoa (lsah->adv_router));
   zlog_info ("    LS sequence number 0x%lx", (u_long)ntohl (lsah->ls_seqnum));
index 22611d8dd9674fd901493abf963cadb942c4fe1a..71910dd75c399cff85a0cc9d17b785d364c72971 100644 (file)
@@ -121,7 +121,7 @@ ospf_process_self_originated_lsa (struct ospf *ospf,
   if (IS_DEBUG_OSPF_EVENT)
     zlog_info ("LSA[Type%d:%s]: Process self-originated LSA seq 0x%lx",
               new->data->type, inet_ntoa (new->data->id), 
-              (u_long)new->data->ls_seqnum);
+              ntohl(new->data->ls_seqnum));
 
   /* If we're here, we installed a self-originated LSA that we received
      from a neighbor, i.e. it's more recent.  We must see whether we want
index 4711f0feb288ead61d1cc6b5b2b5435cfa6b887c..b7550b13f0711d482b5a42e8c1f92ab0d523d5eb 100644 (file)
@@ -2380,9 +2380,9 @@ ospf_router_lsa_install (struct ospf *ospf,
       area->router_lsa_self = ospf_lsa_lock (new);
 
       if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
-       zlog_info("LSA[Type%d]: ID %s seq 0x%x is self-originated",
-                 new->data->type, inet_ntoa (new->data->id), 
-                 new->data->ls_seqnum);
+        zlog_info("LSA[Type%d]: ID %s seq 0x%x is self-originated",
+                  new->data->type, inet_ntoa (new->data->id),
+                  ntohl(new->data->ls_seqnum));
     }
 
   return new;
@@ -2652,12 +2652,13 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_interface *oi,
       can be originated. "
    */
 
-  if (lsa->data->ls_seqnum - 1 == htonl(OSPF_MAX_SEQUENCE_NUMBER))
+  if (ntohl(lsa->data->ls_seqnum) - 1 ==  htonl(OSPF_MAX_SEQUENCE_NUMBER)
     {
       if (ospf_lsa_is_self_originated(ospf, lsa))
         {
-         lsa->data->ls_seqnum = htonl(OSPF_MAX_SEQUENCE_NUMBER);
-         if (!IS_LSA_MAXAGE(lsa))
+          lsa->data->ls_seqnum = htonl(OSPF_MAX_SEQUENCE_NUMBER);
+          
+          if (!IS_LSA_MAXAGE(lsa))
             lsa->flags |= OSPF_LSA_PREMATURE_AGE;
           lsa->data->ls_age = htons (OSPF_LSA_MAXAGE);
        
@@ -2769,8 +2770,10 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_interface *oi,
       (IS_LSA_MAXAGE (new) && !IS_LSA_SELF (new)))
     {
       if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
-       zlog_info ("LSA[Type%d:%s]: Install LSA 0x%lx, MaxAge",
-                  new->data->type, inet_ntoa (new->data->id), (u_long)lsa);
+        zlog_info ("LSA[Type%d:%s]: Install LSA 0x%p, MaxAge",
+                   new->data->type, 
+                   inet_ntoa (new->data->id), 
+                   lsa);
       ospf_lsa_maxage (ospf, lsa);
     }