]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: Fix double increment of Sequence Number
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 14 Jan 2016 14:19:29 +0000 (09:19 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Jan 2016 00:27:45 +0000 (16:27 -0800)
When OSPF6 is creating the header for the ROUTER LSA type
if the packet being sent has interface information to add
to the data, the Sequence Number is at least double incremented.

This change moves the header creation to outside the loop over
all interfaces in the area.  Additionally the header is created
at the bottom of the function now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospf6d/ospf6_intra.c

index 1e8c6f3d963d20089713c4eb5f892fa397217659..1ecac2813f0b0fb9a5fcaa3f299d008754b83c5b 100644 (file)
@@ -255,30 +255,6 @@ ospf6_router_lsa_originate (struct thread *thread)
               return 0;
             }
 
-          /* Fill LSA Header */
-          lsa_header->age = 0;
-          lsa_header->type = htons (OSPF6_LSTYPE_ROUTER);
-          lsa_header->id = htonl (link_state_id);
-          lsa_header->adv_router = oa->ospf6->router_id;
-          lsa_header->seqnum =
-            ospf6_new_ls_seqnum (lsa_header->type, lsa_header->id,
-                                 lsa_header->adv_router, oa->lsdb);
-          lsa_header->length = htons ((caddr_t) lsdesc - (caddr_t) buffer);
-
-          /* LSA checksum */
-          ospf6_lsa_checksum (lsa_header);
-
-          /* create LSA */
-          lsa = ospf6_lsa_create (lsa_header);
-
-          /* Originate */
-          ospf6_lsa_originate_area (lsa, oa);
-
-          /* Reset setting for consecutive origination */
-          memset ((caddr_t) router_lsa + sizeof (struct ospf6_router_lsa),
-                  0, (caddr_t) lsdesc - (caddr_t) router_lsa);
-          lsdesc = (struct ospf6_router_lsdesc *)
-            ((caddr_t) router_lsa + sizeof (struct ospf6_router_lsa));
           link_state_id ++;
         }