Minor OSPF changes for faster startup.

This commit is contained in:
Ondrej Filip 2003-08-23 10:47:46 +00:00
parent baa5dd6ccc
commit 1d1a3c1c2a
2 changed files with 7 additions and 14 deletions

View file

@ -39,7 +39,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
switch(n->state) switch(n->state)
{ {
case NEIGHBOR_EXSTART: /* Send empty packets */ case NEIGHBOR_EXSTART: /* Send empty packets */
n->myimms.bit.i=1;
pkt=(struct ospf_dbdes_packet *)(ifa->ip_sk->tbuf); pkt=(struct ospf_dbdes_packet *)(ifa->ip_sk->tbuf);
op=(struct ospf_packet *)pkt; op=(struct ospf_packet *)pkt;
fill_ospf_pkt_hdr(ifa, pkt, DBDES_P); fill_ospf_pkt_hdr(ifa, pkt, DBDES_P);
@ -56,8 +55,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
break; break;
case NEIGHBOR_EXCHANGE: case NEIGHBOR_EXCHANGE:
n->myimms.bit.i=0;
if(((n->myimms.bit.ms) && (n->dds==n->ddr+1)) || if(((n->myimms.bit.ms) && (n->dds==n->ddr+1)) ||
((!(n->myimms.bit.ms)) && (n->dds==n->ddr))) ((!(n->myimms.bit.ms)) && (n->dds==n->ddr)))
{ {
@ -73,7 +70,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
pkt->ddseq=htonl(n->dds); pkt->ddseq=htonl(n->dds);
j=i=(ifa->iface->mtu-sizeof(struct ospf_dbdes_packet)-SIPH)/ j=i=(ifa->iface->mtu-sizeof(struct ospf_dbdes_packet)-SIPH)/
sizeof(struct ospf_lsa_header); /* Number of lsaheaders */ sizeof(struct ospf_lsa_header); /* Number of possible lsaheaders to send */
lsa=(n->ldbdes+sizeof(struct ospf_dbdes_packet)); lsa=(n->ldbdes+sizeof(struct ospf_dbdes_packet));
if(n->myimms.bit.m) if(n->myimms.bit.m)
@ -116,7 +113,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
op->length=htons(length); op->length=htons(length);
ospf_pkt_finalize(ifa, op); ospf_pkt_finalize(ifa, op);
DBG("%s: DB_DES (M) sent to %I.\n", p->name, n->ip); DBG("%s: DB_DES (M) prepared for %I.\n", p->name, n->ip);
} }
case NEIGHBOR_LOADING: case NEIGHBOR_LOADING:
@ -142,7 +139,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
{ {
ospf_neigh_sm(n, INM_EXDONE); ospf_neigh_sm(n, INM_EXDONE);
if(n->myimms.bit.ms) tm_stop(n->rxmt_timer); if(n->myimms.bit.ms) tm_stop(n->rxmt_timer);
else tm_start(n->rxmt_timer,ifa->rxmtint);
} }
} }
break; break;
@ -282,9 +278,9 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
break; break;
} }
} }
if(ps->imms.bit.i) break;
case NEIGHBOR_EXCHANGE: case NEIGHBOR_EXCHANGE:
if((ps->imms.byte==n->imms.byte) && (ps->options=n->options) && if((ps->imms.byte==n->imms.byte) && (ps->options==n->options) &&
(ntohl(ps->ddseq)==n->ddr)) (ntohl(ps->ddseq)==n->ddr))
{ {
/* Duplicate packet */ /* Duplicate packet */
@ -359,7 +355,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
break; break;
case NEIGHBOR_LOADING: case NEIGHBOR_LOADING:
case NEIGHBOR_FULL: case NEIGHBOR_FULL:
if((ps->imms.byte==n->imms.byte) && (ps->options=n->options) && if((ps->imms.byte==n->imms.byte) && (ps->options==n->options) &&
(ps->ddseq==n->dds)) /* Only duplicate are accepted */ (ps->ddseq==n->dds)) /* Only duplicate are accepted */
{ {
OSPF_TRACE(D_PACKETS, "Received duplicate dbdes from %I.",n->ip); OSPF_TRACE(D_PACKETS, "Received duplicate dbdes from %I.",n->ip);

View file

@ -67,11 +67,6 @@ neigh_chstate(struct ospf_neighbor *n, u8 state)
schedule_rt_lsa(ifa->oa); schedule_rt_lsa(ifa->oa);
schedule_net_lsa(ifa); schedule_net_lsa(ifa);
} }
if(oldstate>=NEIGHBOR_EXSTART && state<NEIGHBOR_EXSTART)
{
/* Stop RXMT timer */
tm_stop(n->rxmt_timer);
}
if(state==NEIGHBOR_EXSTART) if(state==NEIGHBOR_EXSTART)
{ {
if(n->adj==0) /* First time adjacency */ if(n->adj==0) /* First time adjacency */
@ -86,6 +81,8 @@ neigh_chstate(struct ospf_neighbor *n, u8 state)
tm_start(n->rxmt_timer,1); /* Or some other number ? */ tm_start(n->rxmt_timer,1); /* Or some other number ? */
} }
if(state<NEIGHBOR_EXCHANGE) tm_stop(n->lsrr_timer); if(state<NEIGHBOR_EXCHANGE) tm_stop(n->lsrr_timer);
if(state<NEIGHBOR_EXSTART) tm_stop(n->rxmt_timer);
if(state>NEIGHBOR_EXSTART) n->myimms.bit.i=0;
} }
} }