From 92e8be8c898932bf959e722acfbb33d154b8fcc4 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Fri, 2 Jun 2000 09:42:24 +0000 Subject: Bugfix in lsreq receiving. --- proto/ospf/lsreq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/proto/ospf/lsreq.c b/proto/ospf/lsreq.c index 4a78d06..818aacc 100644 --- a/proto/ospf/lsreq.c +++ b/proto/ospf/lsreq.c @@ -91,7 +91,8 @@ lsrr_timer_hook(timer *timer) llsh->lsh.id=en->lsa.id; llsh->lsh.rt=en->lsa.rt; llsh->lsh.type=en->lsa.type; - DBG("Working on ID: %I, RT: %I, Type: %u\n",en->lsa.id,en->lsa.rt,en->lsa.type); + DBG("Working on ID: %I, RT: %I, Type: %u\n", + en->lsa.id, en->lsa.rt, en->lsa.type); add_tail(&uplist, NODE llsh); } ospf_lsupd_tx_list(n, &uplist); @@ -111,7 +112,7 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p, list uplist; slab *upslab; int length; - u8 i; + int i,lsano; nrid=ntohl(ps->ospf_packet.routerid); @@ -127,13 +128,14 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p, debug("%s: Received LS req from neighbor: %I\n",p->name, n->ip); - length=htons(ps->ospf_packet.length); + length=ntohs(ps->ospf_packet.length); lsh=(void *)(ps+1); init_list(&uplist); upslab=sl_new(p->pool,sizeof(struct l_lsr_head)); - for(i=0;i<(length-sizeof(struct ospf_lsreq_packet))/ - sizeof(struct ospf_lsreq_header);i++); + lsano=(length-sizeof(struct ospf_lsreq_packet))/ + sizeof(struct ospf_lsreq_header); + for(i=0;iid), lsh->type, ntohl(lsh->rt)); @@ -145,7 +147,7 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p, if(ospf_hash_find(n->ifa->oa->gr, llsh->lsh.id, llsh->lsh.rt, llsh->lsh.type)==NULL) { - debug("Received bad LS req from: %I looking: RT: %I, ID: %I, Type: %u", + log("Received bad LS req from: %I looking: RT: %I, ID: %I, Type: %u", n->ip, lsh->rt, lsh->id, lsh->type); ospf_neigh_sm(n,INM_BADLSREQ); rfree(upslab); -- cgit v1.2.3