summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsupd.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-06-04 22:41:02 +0200
committerOndrej Filip <feela@network.cz>2004-06-04 22:41:02 +0200
commit9b7de4c4d13a5701aac446627672e65fce9e1a9d (patch)
tree72a8e8742eff396abdf463ef1311310aed258ec9 /proto/ospf/lsupd.c
parent54467ed46b31e29215e50d32b0a757998de29793 (diff)
downloadbird-9b7de4c4d13a5701aac446627672e65fce9e1a9d.tar
bird-9b7de4c4d13a5701aac446627672e65fce9e1a9d.zip
'struct proto' removed
Finally, I found the bug reported by Andreas Steinmetz. FIXED.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r--proto/ospf/lsupd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index 752ba36..c04f16b 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -261,22 +261,21 @@ ospf_lsupd_tx_list(struct ospf_neighbor *n, list *l)
}
void
-ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
+ospf_lsupd_receive(struct ospf_lsupd_packet *ps,
struct ospf_iface *ifa, u16 size)
{
- u32 area,nrid,myrid;
+ u32 area,nrid;
struct ospf_neighbor *n,*ntmp;
struct ospf_lsa_header *lsa;
struct ospf_area *oa;
- struct proto_ospf *po=(struct proto_ospf *)p;
+ struct proto_ospf *po=ifa->proto;
+ struct proto *p = (struct proto *)po;
u16 length;
u8 i;
+ int sendreq = 1;
nrid=ntohl(ps->ospf_packet.routerid);
- myrid=p->cf->global->router_id;
-
-
if((n=find_neigh(ifa, nrid))==NULL)
{
OSPF_TRACE(D_PACKETS, "Received lsupd from unknown neighbor! (%I)",
@@ -424,6 +423,7 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
if(lsadb && ((now-lsadb->inst_t)<=MINLSARRIVAL)) /* FIXME: test for flooding? */
{
DBG("I got it in less that MINLSARRIVAL\n");
+ sendreq = 0;
continue;
}
@@ -496,6 +496,7 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
/* pg145 (7b) */
ospf_lsack_enqueue(n, lsa, ACKL_DIRECT);
}
+ sendreq = 0;
continue;
}
@@ -520,9 +521,9 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
/* Send direct LSAs */
ospf_lsack_send(n, ACKL_DIRECT);
- if(n->state==NEIGHBOR_LOADING)
+ if(sendreq && (n->state==NEIGHBOR_LOADING))
{
- ospf_lsreq_send(n); /* Send me another part of database */
+ ospf_lsreq_send(n); /* Ask for another part of neighbor's database */
}
}