summaryrefslogtreecommitdiffstats
path: root/proto/ospf/topology.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-03-31 03:14:41 +0200
committerOndrej Filip <feela@network.cz>2000-03-31 03:14:41 +0200
commit9f940976d10e6295f78adf4afb1868a7ed6cac73 (patch)
treeed1c231e059741e5ac2b0a51d06d96673ec324ed /proto/ospf/topology.c
parentf45fd3164bf2f9342e12e867f8d68c7fc77d3177 (diff)
downloadbird-9f940976d10e6295f78adf4afb1868a7ed6cac73.tar
bird-9f940976d10e6295f78adf4afb1868a7ed6cac73.zip
Some bug fixes. LSA checksum is still bad. I'll fix it later.
Diffstat (limited to 'proto/ospf/topology.c')
-rw-r--r--proto/ospf/topology.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index 6bbc5e7..808fc7b 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -27,7 +27,8 @@ unsigned int
make_rt_lsa(struct ospf_area *oa, struct proto_ospf *p)
{
struct ospf_iface *ifa;
- int i=0,j=0,k=0,v=0,e=0,b=0;
+ int j=0,k=0,v=0,e=0,b=0;
+ u16 i=0;
struct ospf_lsa_rt *rt;
struct ospf_lsa_rt_link *ln;
struct ospf_neighbor *neigh;
@@ -147,7 +148,7 @@ make_rt_lsa(struct ospf_area *oa, struct proto_ospf *p)
rt->links=i;
if(old->lsa_body!=NULL) mb_free(old->lsa_body);
old->lsa_body=rt;
- return rt->links*sizeof(struct ospf_lsa_rt_link)+sizeof(struct ospf_lsa_rt);
+ return i*sizeof(struct ospf_lsa_rt_link)+sizeof(struct ospf_lsa_rt);
}
@@ -188,14 +189,14 @@ addifa_rtlsa(struct ospf_iface *ifa)
lsa=&(oa->rt->lsa);
oa->rt->lsa_body=NULL;
lsa->age=0;
- lsa->sn=LSA_INITSEQNO-1; /* FIXME Check it latter */
+ lsa->sn=LSA_INITSEQNO; /* FIXME Check it latter */
lsa->checksum=0;
lsa->checksum=ipsum_calculate(lsa,sizeof(struct ospf_lsa_header),NULL);
ifa->oa=oa;
DBG("%s: New OSPF area \"%d\" added.\n", po->proto.name, ifa->an);
}
- oa->rt->body_len=make_rt_lsa(oa, po);
+ oa->rt->lsa.length=make_rt_lsa(oa, po)+sizeof(struct ospf_lsa_header);
/*FIXME seq no++ */
/*FIXME lsa_flood(oa->rt) */
}