summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsupd.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r--proto/ospf/lsupd.c26
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));
+ }
}