2000-03-30 20:00:42 +00:00
|
|
|
/*
|
|
|
|
* BIRD -- OSPF
|
|
|
|
*
|
|
|
|
* (c) 2000 Ondrej Filip <feela@network.cz>
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ospf.h"
|
|
|
|
|
2000-04-18 21:40:11 +00:00
|
|
|
int
|
2000-04-05 00:51:25 +00:00
|
|
|
flood_lsa(struct ospf_neighbor *n, struct ospf_lsa_header *hn,
|
2000-04-17 20:42:42 +00:00
|
|
|
struct ospf_lsa_header *hh, struct proto_ospf *po, struct ospf_iface *iff,
|
|
|
|
struct ospf_area *oa)
|
2000-04-05 00:51:25 +00:00
|
|
|
{
|
|
|
|
struct ospf_iface *ifa;
|
|
|
|
struct ospf_neighbor *nn;
|
|
|
|
struct top_hash_entry *en;
|
2000-04-18 21:40:11 +00:00
|
|
|
int ret,retval=0;
|
2000-04-05 00:51:25 +00:00
|
|
|
|
|
|
|
/* pg 148 */
|
|
|
|
WALK_LIST(NODE ifa,po->iface_list)
|
|
|
|
{
|
|
|
|
if(hh->type==LSA_T_EXT)
|
|
|
|
{
|
|
|
|
if(ifa->type==OSPF_IT_VLINK) continue;
|
|
|
|
if(ifa->oa->stub) continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-04-17 20:42:42 +00:00
|
|
|
if(oa->areaid==BACKBONE)
|
2000-04-05 00:51:25 +00:00
|
|
|
{
|
2000-04-17 20:42:42 +00:00
|
|
|
if((ifa->type!=OSPF_IT_VLINK)&&(ifa->oa!=oa)) continue;
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-04-17 20:42:42 +00:00
|
|
|
if(ifa->oa!=oa) continue;
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ret=0;
|
|
|
|
WALK_LIST(NODE nn, ifa->neigh_list)
|
|
|
|
{
|
|
|
|
if(nn->state<NEIGHBOR_EXCHANGE) continue;
|
|
|
|
if(nn->state<NEIGHBOR_FULL)
|
|
|
|
{
|
|
|
|
|
|
|
|
if((en=ospf_hash_find_header(nn->lsrqh,hh))!=NULL)
|
|
|
|
{
|
|
|
|
switch(lsa_comp(hh,&en->lsa))
|
|
|
|
{
|
|
|
|
case CMP_OLDER:
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
case CMP_SAME:
|
|
|
|
s_rem_node(SNODE en);
|
2000-04-18 18:29:50 +00:00
|
|
|
DBG("Removing from lsreq list for neigh %I\n", nn->rid);
|
2000-04-05 00:51:25 +00:00
|
|
|
ospf_hash_delete(nn->lsrqh,en);
|
|
|
|
if(EMPTY_SLIST(nn->lsrql)) ospf_neigh_sm(nn, INM_LOADDONE);
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
case CMP_NEWER:
|
|
|
|
s_rem_node(SNODE en);
|
2000-04-18 18:29:50 +00:00
|
|
|
DBG("Removing from lsreq list for neigh %I\n", nn->rid);
|
2000-04-05 00:51:25 +00:00
|
|
|
ospf_hash_delete(nn->lsrqh,en);
|
|
|
|
if(EMPTY_SLIST(nn->lsrql)) ospf_neigh_sm(nn, INM_LOADDONE);
|
|
|
|
break;
|
|
|
|
default: bug("Bug in lsa_comp?\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(nn==n) continue;
|
2000-05-09 18:17:34 +00:00
|
|
|
if((en=ospf_hash_find_header(nn->lsrth, hh))==NULL)
|
|
|
|
{
|
|
|
|
en=ospf_hash_get_header(nn->lsrth, hh);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s_rem_node(SNODE en);
|
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
s_add_tail(&nn->lsrtl, SNODE en);
|
|
|
|
ret=1;
|
2000-05-09 18:17:34 +00:00
|
|
|
DBG("Adding LSA lsrt RT: %I, Id: %I, Type: %u for n: %I\n",
|
|
|
|
en->lsa.rt,en->lsa.id, en->lsa.type, nn->ip);
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
|
|
|
if(ret==0) continue;
|
|
|
|
if(ifa==iff)
|
|
|
|
{
|
|
|
|
if((n->rid==iff->drid)||n->rid==iff->bdrid) continue;
|
2000-04-18 21:40:11 +00:00
|
|
|
if(iff->state==OSPF_IS_BACKUP) continue;
|
|
|
|
retval=1;
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
2000-04-18 22:07:58 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
{
|
|
|
|
sock *sk;
|
|
|
|
ip_addr to;
|
|
|
|
u16 len;
|
|
|
|
struct ospf_lsupd_packet *pk;
|
|
|
|
struct ospf_packet *op;
|
|
|
|
|
2000-04-17 20:42:42 +00:00
|
|
|
if(ifa->type==OSPF_IT_NBMA) sk=ifa->ip_sk;
|
|
|
|
else sk=ifa->hello_sk; /* FIXME is this true for PTP? */
|
2000-04-05 00:51:25 +00:00
|
|
|
|
|
|
|
pk=(struct ospf_lsupd_packet *)sk->tbuf;
|
|
|
|
op=(struct ospf_packet *)sk->tbuf;
|
|
|
|
|
|
|
|
fill_ospf_pkt_hdr(ifa, pk, LSUPD);
|
|
|
|
pk->lsano=htonl(1);
|
2000-04-17 20:42:42 +00:00
|
|
|
if(hn!=NULL)
|
|
|
|
{
|
|
|
|
memcpy(pk+1,hn,ntohs(hn->length));
|
|
|
|
len=sizeof(struct ospf_lsupd_packet)+ntohs(hn->length);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
u8 *help;
|
|
|
|
struct top_hash_entry *en;
|
2000-05-02 22:31:48 +00:00
|
|
|
struct ospf_lsa_header *lh;
|
|
|
|
u16 age;
|
|
|
|
|
|
|
|
lh=(struct ospf_lsa_header *)(pk+1);
|
|
|
|
htonlsah(hh,lh);
|
|
|
|
age=hh->age;
|
|
|
|
age+=ifa->inftransdelay;
|
|
|
|
if(age>LSA_MAXAGE) age=LSA_MAXAGE;
|
|
|
|
lh->age=htons(age);
|
|
|
|
help=(u8 *)(lh+1);
|
2000-04-17 20:42:42 +00:00
|
|
|
en=ospf_hash_find_header(oa->gr,hh);
|
2000-05-04 01:23:03 +00:00
|
|
|
htonlsab(en->lsa_body,help,hh->type,hh->length
|
|
|
|
-sizeof(struct ospf_lsa_header));
|
2000-04-17 20:42:42 +00:00
|
|
|
len=hh->length;
|
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
op->length=htons(len);
|
|
|
|
ospf_pkt_finalize(ifa, op);
|
|
|
|
|
|
|
|
if(ifa->type==OSPF_IT_NBMA)
|
|
|
|
{
|
2000-04-18 01:06:16 +00:00
|
|
|
sk_send_to_agt(sk ,len, ifa, NEIGHBOR_EXCHANGE);
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((ifa->state==OSPF_IS_BACKUP)||(ifa->state==OSPF_IS_DR))
|
|
|
|
sk_send_to(sk,len, AllSPFRouters, OSPF_PROTO);
|
|
|
|
else sk_send_to(sk,len, AllDRouters, OSPF_PROTO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-04-18 21:40:11 +00:00
|
|
|
return retval;
|
2000-04-05 00:51:25 +00:00
|
|
|
}
|
|
|
|
|
2000-03-31 00:21:41 +00:00
|
|
|
void /* I send all I received in LSREQ */
|
|
|
|
ospf_lsupd_tx_list(struct ospf_neighbor *n, list *l)
|
|
|
|
{
|
|
|
|
struct l_lsr_head *llsh;
|
|
|
|
u16 len;
|
|
|
|
u32 lsano;
|
|
|
|
struct top_hash_entry *en;
|
|
|
|
struct ospf_lsupd_packet *pk;
|
|
|
|
struct ospf_packet *op;
|
2000-05-09 18:17:34 +00:00
|
|
|
struct proto *p=&n->ifa->oa->po->proto;
|
2000-03-31 00:21:41 +00:00
|
|
|
void *pktpos;
|
2000-03-31 01:14:41 +00:00
|
|
|
u8 ii;
|
|
|
|
u8 *jj=n->ifa->ip_sk->tbuf;
|
2000-03-31 00:21:41 +00:00
|
|
|
|
2000-05-09 12:31:38 +00:00
|
|
|
if(EMPTY_LIST(*l)) return;
|
2000-03-31 00:21:41 +00:00
|
|
|
|
|
|
|
pk=(struct ospf_lsupd_packet *)n->ifa->ip_sk->tbuf;
|
|
|
|
op=(struct ospf_packet *)n->ifa->ip_sk->tbuf;
|
2000-03-31 01:14:41 +00:00
|
|
|
|
|
|
|
DBG("LSupd: 1st packet\n");
|
2000-03-31 00:21:41 +00:00
|
|
|
|
|
|
|
fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
|
|
|
|
len=SIPH+sizeof(struct ospf_lsupd_packet);
|
|
|
|
lsano=0;
|
|
|
|
pktpos=(pk+1);
|
|
|
|
|
|
|
|
WALK_LIST(llsh, *l)
|
|
|
|
{
|
2000-05-09 18:20:39 +00:00
|
|
|
if((en=ospf_hash_find(n->ifa->oa->gr,llsh->lsh.id,llsh->lsh.rt,
|
|
|
|
llsh->lsh.type))==NULL) continue; /* Probably flushed LSA */
|
|
|
|
|
2000-04-18 18:29:50 +00:00
|
|
|
DBG("Sending ID=%I, Type=%u, RT=%I\n", llsh->lsh.id, llsh->lsh.type,
|
2000-03-31 01:14:41 +00:00
|
|
|
llsh->lsh.rt);
|
2000-05-09 13:56:47 +00:00
|
|
|
if((len+en->lsa.length)>n->ifa->iface->mtu)
|
2000-03-31 00:21:41 +00:00
|
|
|
{
|
|
|
|
pk->lsano=htonl(lsano);
|
|
|
|
op->length=htons(len);
|
|
|
|
ospf_pkt_finalize(n->ifa, op);
|
2000-03-31 01:14:41 +00:00
|
|
|
|
2000-03-31 00:21:41 +00:00
|
|
|
sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
|
2000-05-09 18:17:34 +00:00
|
|
|
debug("%s: LS upd sent to %I\n", p->name, n->ip);
|
2000-03-31 00:21:41 +00:00
|
|
|
|
2000-03-31 01:14:41 +00:00
|
|
|
DBG("LSupd: next packet\n");
|
2000-03-31 00:21:41 +00:00
|
|
|
fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
|
|
|
|
len=SIPH+sizeof(struct ospf_lsupd_packet);
|
|
|
|
lsano=0;
|
|
|
|
pktpos=(pk+1);
|
|
|
|
}
|
|
|
|
htonlsah(&(en->lsa), pktpos);
|
|
|
|
pktpos=pktpos+sizeof(struct ospf_lsa_header);
|
2000-05-04 01:23:03 +00:00
|
|
|
htonlsab(en->lsa_body, pktpos, en->lsa.type, en->lsa.length
|
|
|
|
-sizeof(struct ospf_lsa_header));
|
2000-03-31 01:14:41 +00:00
|
|
|
pktpos=pktpos+en->lsa.length-sizeof(struct ospf_lsa_header);
|
|
|
|
len=len+en->lsa.length;
|
|
|
|
lsano++;
|
2000-03-31 00:21:41 +00:00
|
|
|
}
|
|
|
|
pk->lsano=htonl(lsano);
|
2000-03-31 01:14:41 +00:00
|
|
|
op->length=htons(len-SIPH);
|
2000-03-31 00:21:41 +00:00
|
|
|
ospf_pkt_finalize(n->ifa, op);
|
2000-03-31 01:14:41 +00:00
|
|
|
|
|
|
|
for(ii=0;ii<(len-SIPH);ii+=4)
|
|
|
|
DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
|
|
|
|
|
2000-03-31 00:21:41 +00:00
|
|
|
sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
|
2000-05-09 18:17:34 +00:00
|
|
|
debug("%s: LS upd sent to %I\n", p->name, n->ip);
|
2000-03-31 00:21:41 +00:00
|
|
|
}
|
|
|
|
|
2000-03-30 20:00:42 +00:00
|
|
|
void
|
|
|
|
ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
|
|
|
|
struct ospf_iface *ifa, u16 size)
|
|
|
|
{
|
2000-04-02 20:41:33 +00:00
|
|
|
u32 area,nrid,myrid;
|
2000-04-04 15:55:55 +00:00
|
|
|
struct ospf_neighbor *n,*ntmp;
|
2000-04-02 20:41:33 +00:00
|
|
|
struct ospf_lsa_header *lsa;
|
2000-04-03 22:31:07 +00:00
|
|
|
struct ospf_area *oa;
|
2000-04-04 00:32:17 +00:00
|
|
|
struct proto_ospf *po=(struct proto_ospf *)p;
|
2000-04-02 20:41:33 +00:00
|
|
|
u16 length;
|
2000-03-30 20:00:42 +00:00
|
|
|
u8 i;
|
|
|
|
|
|
|
|
nrid=ntohl(ps->ospf_packet.routerid);
|
|
|
|
|
|
|
|
myrid=p->cf->global->router_id;
|
|
|
|
|
|
|
|
if((n=find_neigh(ifa, nrid))==NULL)
|
|
|
|
{
|
2000-04-18 18:29:50 +00:00
|
|
|
debug("%s: Received lsupd from unknown neigbor! (%I)\n", p->name,
|
2000-03-30 20:00:42 +00:00
|
|
|
nrid);
|
|
|
|
return ;
|
|
|
|
}
|
2000-04-02 20:41:33 +00:00
|
|
|
if(n->state<NEIGHBOR_EXCHANGE)
|
|
|
|
{
|
2000-04-18 18:29:50 +00:00
|
|
|
debug("%s: Received lsupd in lesser state than EXCHANGE from (%I)\n",
|
2000-05-08 22:10:10 +00:00
|
|
|
p->name,n->ip);
|
2000-04-02 20:41:33 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-05-09 18:17:34 +00:00
|
|
|
debug("%s: Received LS upd from (%I)\n", p->name, n->ip);
|
|
|
|
|
2000-04-02 20:41:33 +00:00
|
|
|
lsa=(struct ospf_lsa_header *)(ps+1);
|
|
|
|
area=htonl(ps->ospf_packet.areaid);
|
2000-04-03 22:31:07 +00:00
|
|
|
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)))
|
2000-04-02 20:41:33 +00:00
|
|
|
{
|
2000-04-04 00:32:17 +00:00
|
|
|
struct ospf_lsa_header lsatmp;
|
|
|
|
struct top_hash_entry *lsadb;
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 143 (1) */
|
2000-04-04 00:32:17 +00:00
|
|
|
if(lsa->checksum!=lsasum_check(lsa,NULL,po))
|
2000-04-02 20:41:33 +00:00
|
|
|
{
|
2000-04-18 18:29:50 +00:00
|
|
|
log("Received bad lsa checksum from %I\n",n->rid);
|
2000-04-03 22:31:07 +00:00
|
|
|
continue;
|
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 143 (2) */
|
2000-04-03 22:31:07 +00:00
|
|
|
if((lsa->type<LSA_T_RT)||(lsa->type>LSA_T_EXT))
|
|
|
|
{
|
2000-04-18 18:29:50 +00:00
|
|
|
log("Unknown LSA type from %I\n",n->rid);
|
2000-04-03 22:31:07 +00:00
|
|
|
continue;
|
2000-04-02 20:41:33 +00:00
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 143 (3) */
|
2000-04-03 22:31:07 +00:00
|
|
|
if((lsa->type==LSA_T_EXT)&&oa->stub)
|
|
|
|
{
|
2000-04-18 18:29:50 +00:00
|
|
|
log("Received External LSA in stub area from %I\n",n->rid);
|
2000-04-03 22:31:07 +00:00
|
|
|
continue;
|
|
|
|
}
|
2000-04-04 00:32:17 +00:00
|
|
|
ntohlsah(lsa,&lsatmp);
|
2000-04-18 18:29:50 +00:00
|
|
|
DBG("Processing update Type: %u ID: %I RT: %I\n",lsatmp.type,
|
2000-04-04 15:55:55 +00:00
|
|
|
lsatmp.id, lsatmp.rt);
|
2000-04-04 00:32:17 +00:00
|
|
|
lsadb=ospf_hash_find_header(oa->gr, &lsatmp);
|
2000-04-04 15:55:55 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 143 (4) */
|
2000-04-04 00:32:17 +00:00
|
|
|
if((lsatmp.age==LSA_MAXAGE)&&(lsadb==NULL))
|
|
|
|
{
|
|
|
|
int flag=0;
|
2000-04-18 01:06:16 +00:00
|
|
|
struct ospf_iface *ifatmp;
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-18 01:06:16 +00:00
|
|
|
WALK_LIST(NODE ifatmp,po->iface_list)
|
|
|
|
WALK_LIST(NODE ntmp,ifatmp->neigh_list)
|
2000-04-04 15:55:55 +00:00
|
|
|
if((ntmp->state==NEIGHBOR_EXCHANGE)&&
|
|
|
|
(ntmp->state==NEIGHBOR_LOADING))
|
2000-04-04 00:32:17 +00:00
|
|
|
flag=1;
|
2000-04-18 21:40:11 +00:00
|
|
|
DBG("PG143(4): Flag=%u\n",flag);
|
2000-04-04 00:32:17 +00:00
|
|
|
|
|
|
|
if(flag==0)
|
|
|
|
{
|
2000-04-18 01:06:16 +00:00
|
|
|
ospf_lsack_direct_tx(n,lsa);
|
2000-04-04 00:32:17 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 144 (5) */
|
2000-04-04 00:32:17 +00:00
|
|
|
if((lsadb==NULL)||(lsa_comp(&lsatmp,&lsadb->lsa)==CMP_NEWER))
|
|
|
|
{
|
2000-04-05 00:51:25 +00:00
|
|
|
struct ospf_iface *ift=NULL;
|
2000-04-04 15:55:55 +00:00
|
|
|
void *body;
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-18 21:40:11 +00:00
|
|
|
DBG("PG143(5): Received LSA is newer\n");
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 144 (5a) */
|
2000-04-18 22:11:05 +00:00
|
|
|
if(lsadb && ((now-lsadb->inst_t)<MINLSARRIVAL))
|
|
|
|
{
|
|
|
|
DBG("I got it in less that MINLSARRIVAL\n");
|
|
|
|
continue;
|
|
|
|
}
|
2000-04-18 22:07:58 +00:00
|
|
|
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-18 21:40:11 +00:00
|
|
|
if(flood_lsa(n,lsa,&lsatmp,po,ifa,ifa->oa)==0)
|
|
|
|
{
|
2000-04-18 22:11:05 +00:00
|
|
|
DBG("Wasn't flooded back\n");
|
2000-04-18 21:40:11 +00:00
|
|
|
if(ifa->state==OSPF_IS_BACKUP)
|
|
|
|
{
|
|
|
|
if(ifa->drid==n->rid) ospf_lsa_delay(n, lsa, p);
|
|
|
|
}
|
|
|
|
else ospf_lsa_delay(n, lsa, p);
|
|
|
|
}
|
2000-04-05 00:51:25 +00:00
|
|
|
|
2000-04-04 00:32:17 +00:00
|
|
|
/* Remove old from all ret lists */
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 144 (5c) */
|
2000-04-04 15:55:55 +00:00
|
|
|
if(lsadb)
|
2000-04-05 00:51:25 +00:00
|
|
|
WALK_LIST(NODE ift,po->iface_list)
|
|
|
|
WALK_LIST(NODE ntmp,ift->neigh_list)
|
2000-04-04 15:55:55 +00:00
|
|
|
{
|
|
|
|
struct top_hash_entry *en;
|
2000-04-04 22:22:08 +00:00
|
|
|
if(ntmp->state>NEIGHBOR_EXSTART)
|
|
|
|
if((en=ospf_hash_find_header(ntmp->lsrth,&lsadb->lsa))!=NULL)
|
|
|
|
{
|
|
|
|
s_rem_node(SNODE en);
|
|
|
|
ospf_hash_delete(ntmp->lsrth,en);
|
|
|
|
}
|
2000-04-04 15:55:55 +00:00
|
|
|
}
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg 144 (5d) */
|
2000-04-04 15:55:55 +00:00
|
|
|
body=mb_alloc(p->pool,lsatmp.length-sizeof(struct ospf_lsa_header));
|
2000-04-05 00:51:25 +00:00
|
|
|
ntohlsab(lsa+1,body,lsatmp.type,
|
|
|
|
lsatmp.length-sizeof(struct ospf_lsa_header));
|
2000-04-30 22:14:31 +00:00
|
|
|
lsadb=lsa_install_new(&lsatmp,body, oa, p);
|
2000-04-04 22:27:19 +00:00
|
|
|
DBG("New LSA installed in DB\n");
|
2000-04-04 15:55:55 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* FIXME 145 (5f) self originated? */
|
|
|
|
|
2000-04-04 00:32:17 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* FIXME pg145 (6)?? */
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg145 (7) */
|
2000-04-04 00:32:17 +00:00
|
|
|
if(lsa_comp(&lsatmp,&lsadb->lsa)==CMP_SAME)
|
|
|
|
{
|
2000-04-18 21:40:11 +00:00
|
|
|
struct top_hash_entry *en;
|
|
|
|
DBG("PG145(6) Got the same LSA\n");
|
|
|
|
if((en=ospf_hash_find_header(n->lsrth,&lsadb->lsa))!=NULL)
|
|
|
|
{
|
|
|
|
s_rem_node(SNODE en);
|
|
|
|
ospf_hash_delete(n->lsrth, en);
|
|
|
|
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;
|
2000-04-04 00:32:17 +00:00
|
|
|
}
|
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
/* pg145 (8) */
|
2000-04-18 01:06:16 +00:00
|
|
|
if((lsadb->lsa.age==LSA_MAXAGE)&&(lsadb->lsa.sn==LSA_MAXSEQNO))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2000-04-04 00:32:17 +00:00
|
|
|
|
2000-04-05 00:51:25 +00:00
|
|
|
{
|
|
|
|
list l;
|
|
|
|
struct l_lsr_head llsh;
|
|
|
|
init_list(&l);
|
|
|
|
memcpy(&llsh.lsh,&lsadb->lsa,sizeof(struct ospf_lsa_header));
|
|
|
|
add_tail(&l, NODE &llsh);
|
|
|
|
ospf_lsupd_tx_list(n, &l);
|
|
|
|
}
|
2000-04-02 20:41:33 +00:00
|
|
|
}
|
2000-03-30 20:00:42 +00:00
|
|
|
}
|
|
|
|
|