diff options
author | Ondrej Filip <feela@network.cz> | 2000-04-12 15:20:13 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-04-12 15:20:13 +0000 |
commit | 4bf41ac8b1d7edb4754c579b714d1c71dc421b4e (patch) | |
tree | 7e9acc9521d1e5c683736bd5fd6a8aa78947229d /proto/ospf/lsack.c | |
parent | 58313b24c8e31f02f242b7d090b54aab8295ce04 (diff) |
LS Ack receiving done.
Diffstat (limited to 'proto/ospf/lsack.c')
-rw-r--r-- | proto/ospf/lsack.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/proto/ospf/lsack.c b/proto/ospf/lsack.c index f34f7760..5f829704 100644 --- a/proto/ospf/lsack.c +++ b/proto/ospf/lsack.c @@ -20,9 +20,10 @@ ospf_lsack_rx(struct ospf_lsack_packet *ps, struct proto *p, { u32 nrid, myrid; struct ospf_neighbor *n; - struct ospf_lsreq_header *lsh; + struct ospf_lsa_header lsa,*plsa; int length; - u8 i; + u16 nolsa,i; + struct top_hash_entry *en; nrid=ntohl(ps->ospf_packet.routerid); @@ -34,7 +35,28 @@ ospf_lsack_rx(struct ospf_lsack_packet *ps, struct proto *p, nrid); return ; } - /* FIXME Go on! */ + + nolsa=(ntohs(ps->ospf_packet.length)-sizeof(struct ospf_lsack_packet))/ + sizeof(struct ospf_lsa_header); + DBG("Received %d lsa\n",nolsa); + plsa=( struct ospf_lsa_header *)(ps+1); + + for(i=0;i<nolsa;i++) + { + ntohlsah(plsa+i,&lsa); + if((en=ospf_hash_find_header(n->lsrth,&lsa))==NULL) continue; + + if(lsa_comp(&lsa,&en->lsa)!=CMP_SAME) + { + log("Strange LS acknoledgement from %d\n",n->rid); + continue; + } + + DBG("Deleting LS Id: %u RT: % Type: %u from LS Retl for neighbor %u\n", + lsa.id,lsa.rt,lsa.type,n->rid); + s_rem_node(SNODE en); + ospf_hash_delete(n->lsrth,en); + } } void |