diff options
author | Ondrej Filip <feela@network.cz> | 2000-04-02 22:41:33 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-04-02 22:41:33 +0200 |
commit | 394acced118df7360e480920c65ca260c5b8c44f (patch) | |
tree | 8f90c12250f8856d7d38694260bcb4afdf1eaacb /proto/ospf/lsupd.c | |
parent | db9fb727699a6244afcff28dcc2320a3e66ee269 (diff) | |
download | bird-394acced118df7360e480920c65ca260c5b8c44f.tar bird-394acced118df7360e480920c65ca260c5b8c44f.zip |
Work on lsupdates continues. Some checksum cleanup.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r-- | proto/ospf/lsupd.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index 8f9d6aa..2fa0137 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -83,10 +83,10 @@ void ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, struct ospf_iface *ifa, u16 size) { - u32 nrid, myrid; + u32 area,nrid,myrid; struct ospf_neighbor *n; - struct ospf_lsreq_header *lsh; - int length; + struct ospf_lsa_header *lsa; + u16 length; u8 i; nrid=ntohl(ps->ospf_packet.routerid); @@ -99,6 +99,24 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, nrid); return ; } - /* FIXME Go on! */ + if(n->state<NEIGHBOR_EXCHANGE) + { + debug("%s: Received lsupd in lesser state than EXCHANGE from (%u)\n", + p->name); + return; + } + + lsa=(struct ospf_lsa_header *)(ps+1); + area=htonl(ps->ospf_packet.areaid); + for(i=0;i<ntohl(ps->lsano);i++) + { + if(lsa->checksum==lsasum_check(lsa,NULL,(struct proto_ospf *)p)) + { + DBG("Processing update Type: %u ID: %u RT: %u\n",lsa->type, + ntohl(lsa->id), ntohl(lsa->rt)); + /* FIXME Go on */ + } + lsa=(struct ospf_lsa_header *)(((u8 *)lsa)+ntohs(lsa->length)); + } } |