From 67315ef64e3655c65cfab032d637fe29d3cf91b2 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 18 Apr 2000 01:06:16 +0000 Subject: Some lsack work. There is something very worng. :-( It locked my network. --- proto/ospf/lsupd.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'proto/ospf/lsupd.c') diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index 62b6f76..23e7b1c 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -122,12 +122,7 @@ flood_lsa(struct ospf_neighbor *n, struct ospf_lsa_header *hn, if(ifa->type==OSPF_IT_NBMA) { - struct ospf_neighbor *nnn; - WALK_LIST(NODE nnn,ifa->neigh_list) - { - if(nnn->state>NEIGHBOR_EXSTART) - sk_send_to(sk,len, nnn->ip, OSPF_PROTO); - } + sk_send_to_agt(sk ,len, ifa, NEIGHBOR_EXCHANGE); } else { @@ -267,19 +262,19 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, /* pg 143 (4) */ if((lsatmp.age==LSA_MAXAGE)&&(lsadb==NULL)) { - struct ospf_neighbor *n=NULL; - struct ospf_iface *ifa=NULL; int flag=0; + struct ospf_iface *ifatmp; - WALK_LIST(NODE ifa,po->iface_list) - WALK_LIST(NODE ntmp,ifa->neigh_list) + WALK_LIST(NODE ifatmp,po->iface_list) + WALK_LIST(NODE ntmp,ifatmp->neigh_list) if((ntmp->state==NEIGHBOR_EXCHANGE)&& (ntmp->state==NEIGHBOR_LOADING)) flag=1; if(flag==0) { - add_ack_list(n,lsa); + ospf_lsack_direct_tx(n,lsa); + continue; } } @@ -317,7 +312,11 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, lsadb=lsa_install_new(&lsatmp,body, oa); DBG("New LSA installed in DB\n"); - /* FIXME 144 (5e) ack */ + if(ifa->state==OSPF_IS_BACKUP) + { + if(ifa->drid==n->rid) ospf_lsa_delay(n, lsa, p); + } + else if(ifa->drid==n->rid) ospf_lsa_delay(n, lsa, p); /* FIXME 145 (5f) self originated? */ continue; @@ -330,13 +329,25 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p, { struct top_hash_entry *en; if((en=ospf_hash_find_header(n->lsrth,&lsadb->lsa))!=NULL) + { s_rem_node(SNODE en); - /* FIXME ack_lsa() */ + if(ifa->state==OSPF_IS_BACKUP) + { + if(n->rid==ifa->drid) ospf_lsa_delay(n, lsa, p); + } + } + else + { + ospf_lsack_direct_tx(n,lsa); + } continue; } /* pg145 (8) */ - if((lsadb->lsa.age==LSA_MAXAGE)&&(lsadb->lsa.sn==LSA_MAXSEQNO)) continue; + if((lsadb->lsa.age==LSA_MAXAGE)&&(lsadb->lsa.sn==LSA_MAXSEQNO)) + { + continue; + } { list l; -- cgit v1.2.3