{
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) +
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);