diff options
author | Ondrej Filip <feela@network.cz> | 2000-04-03 22:31:07 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-04-03 22:31:07 +0000 |
commit | 8496b2e41a81f8281da0e0c3e4bbb72a57d3bf21 (patch) | |
tree | cfd9083a1d32d7c77fd7e26a8eb83c84322ec9ea /proto/ospf/lsupd.c | |
parent | 394acced118df7360e480920c65ca260c5b8c44f (diff) |
Minor change in area list. Now I use MJ's lists.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r-- | proto/ospf/lsupd.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index 2fa01378..5c0d836d 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -86,6 +86,7 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, u32 area,nrid,myrid; struct ospf_neighbor *n; struct ospf_lsa_header *lsa; + struct ospf_area *oa; u16 length; u8 i; @@ -108,15 +109,28 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, lsa=(struct ospf_lsa_header *)(ps+1); area=htonl(ps->ospf_packet.areaid); - for(i=0;i<ntohl(ps->lsano);i++) + oa=ospf_find_area((struct proto_ospf *)p,area); + for(i=0;i<ntohl(ps->lsano);i++, + lsa=(struct ospf_lsa_header *)(((u8 *)lsa)+ntohs(lsa->length))) { - if(lsa->checksum==lsasum_check(lsa,NULL,(struct proto_ospf *)p)) + 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 */ + log("Received bad lsa checksum from %u\n",n->rid); + continue; + } + if((lsa->type<LSA_T_RT)||(lsa->type>LSA_T_EXT)) + { + log("Unknown LSA type from %u\n",n->rid); + continue; } - lsa=(struct ospf_lsa_header *)(((u8 *)lsa)+ntohs(lsa->length)); + if((lsa->type==LSA_T_EXT)&&oa->stub) + { + log("Received External LSA in stub area from %u\n",n->rid); + continue; + } + /* FIXME Go on */ + DBG("Processing update Type: %u ID: %u RT: %u\n",lsa->type, + ntohl(lsa->id), ntohl(lsa->rt)); } } |