]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor fix in LSA update.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 3 Dec 2009 17:25:14 +0000 (18:25 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 3 Dec 2009 17:25:14 +0000 (18:25 +0100)
proto/ospf/lsack.c
proto/ospf/lsupd.c

index 857f0c12695bbdcc6a5f54810bfd78f5b65b9948..ba9a918a166de83e31af20a2181078c20d9bfbe1 100644 (file)
@@ -76,9 +76,9 @@ ospf_lsack_send(struct ospf_neighbor *n, int queue)
   {
     no = (struct lsah_n *) HEAD(n->ackl[queue]);
     memcpy(h + i, &no->lsa, sizeof(struct ospf_lsa_header));
-    i++;
-    DBG("Iter %u ID: %R, RT: %R, Type: %u\n", i, ntohl((h + i)->id),
+    DBG("Iter %u ID: %R, RT: %R, Type: %04x\n", i, ntohl((h + i)->id),
        ntohl((h + i)->rt), (h + i)->type);
+    i++;
     rem_node(NODE no);
     mb_free(no);
     if ((i * sizeof(struct ospf_lsa_header) +
index b1f6f464a273d24d89d496ff6785dc9ef43043b3..75c670248cfcee3ef964042b92fd463855a029bb 100644 (file)
@@ -449,8 +449,9 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
 
     struct ospf_lsa_header *lsa = (void *) (((u8 *) ps) + offset);
     unsigned int lsalen = ntohs(lsa->length);
-
-    if (((offset + lsalen) > size) || ((lsalen % 4) != 0) ||
+    offset += lsalen;
+    if ((offset > size) || ((lsalen % 4) != 0) ||
        (lsalen <= sizeof(struct ospf_lsa_header)))
     {
       log(L_WARN "Received LSA from %I with bad length", n->ip);