]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor OSPF changes for faster startup.
authorOndrej Filip <feela@network.cz>
Sat, 23 Aug 2003 10:47:46 +0000 (10:47 +0000)
committerOndrej Filip <feela@network.cz>
Sat, 23 Aug 2003 10:47:46 +0000 (10:47 +0000)
proto/ospf/dbdes.c
proto/ospf/neighbor.c

index 6d6c3337278f5438efc32c6e0eaa87fe430e93c6..45241c3d772ba952bcd80f03fc6b4ea9f7dc753e 100644 (file)
@@ -39,7 +39,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
   switch(n->state)
   {
     case NEIGHBOR_EXSTART:             /* Send empty packets */
-      n->myimms.bit.i=1;
       pkt=(struct ospf_dbdes_packet *)(ifa->ip_sk->tbuf);
       op=(struct ospf_packet *)pkt;
       fill_ospf_pkt_hdr(ifa, pkt, DBDES_P);
@@ -56,8 +55,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
       break;
 
     case NEIGHBOR_EXCHANGE:
-      n->myimms.bit.i=0;
-
       if(((n->myimms.bit.ms) && (n->dds==n->ddr+1)) ||
          ((!(n->myimms.bit.ms)) && (n->dds==n->ddr)))
       {
@@ -73,7 +70,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
        pkt->ddseq=htonl(n->dds);
 
        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));
 
        if(n->myimms.bit.m)
@@ -116,7 +113,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
        op->length=htons(length);
        
         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:
@@ -142,7 +139,6 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
        {
           ospf_neigh_sm(n, INM_EXDONE);
          if(n->myimms.bit.ms) tm_stop(n->rxmt_timer);
-         else tm_start(n->rxmt_timer,ifa->rxmtint);
        }
       }
       break;
@@ -282,9 +278,9 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
             break;
           }
         }
-        if(ps->imms.bit.i) break;
+
     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))
         {
           /* Duplicate packet */
@@ -359,7 +355,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
       break;
     case NEIGHBOR_LOADING:
     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 */
         {
           OSPF_TRACE(D_PACKETS, "Received duplicate dbdes from %I.",n->ip);
index bc4d1c3799fbf9a29e721ed5c93ba592e558885a..d9c9b1bea16cc6c200f4fb07ac2a113f4ccacd53 100644 (file)
@@ -67,11 +67,6 @@ neigh_chstate(struct ospf_neighbor *n, u8 state)
       schedule_rt_lsa(ifa->oa);
       schedule_net_lsa(ifa);
     }
-    if(oldstate>=NEIGHBOR_EXSTART && state<NEIGHBOR_EXSTART)
-    {
-      /* Stop RXMT timer */
-      tm_stop(n->rxmt_timer);
-    }
     if(state==NEIGHBOR_EXSTART)
     {
       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 ? */
     }
     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;
   }
 }