Minor fix in LSA update.

This commit is contained in:
Ondrej Zajicek 2009-12-03 18:25:14 +01:00
parent e4a810b0ce
commit 69fbf9a251
2 changed files with 5 additions and 4 deletions

View file

@ -76,9 +76,9 @@ ospf_lsack_send(struct ospf_neighbor *n, int queue)
{ {
no = (struct lsah_n *) HEAD(n->ackl[queue]); no = (struct lsah_n *) HEAD(n->ackl[queue]);
memcpy(h + i, &no->lsa, sizeof(struct ospf_lsa_header)); memcpy(h + i, &no->lsa, sizeof(struct ospf_lsa_header));
i++; DBG("Iter %u ID: %R, RT: %R, Type: %04x\n", i, ntohl((h + i)->id),
DBG("Iter %u ID: %R, RT: %R, Type: %u\n", i, ntohl((h + i)->id),
ntohl((h + i)->rt), (h + i)->type); ntohl((h + i)->rt), (h + i)->type);
i++;
rem_node(NODE no); rem_node(NODE no);
mb_free(no); mb_free(no);
if ((i * sizeof(struct ospf_lsa_header) + if ((i * sizeof(struct ospf_lsa_header) +

View 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); struct ospf_lsa_header *lsa = (void *) (((u8 *) ps) + offset);
unsigned int lsalen = ntohs(lsa->length); unsigned int lsalen = ntohs(lsa->length);
offset += lsalen;
if (((offset + lsalen) > size) || ((lsalen % 4) != 0) || if ((offset > size) || ((lsalen % 4) != 0) ||
(lsalen <= sizeof(struct ospf_lsa_header))) (lsalen <= sizeof(struct ospf_lsa_header)))
{ {
log(L_WARN "Received LSA from %I with bad length", n->ip); log(L_WARN "Received LSA from %I with bad length", n->ip);