summaryrefslogtreecommitdiffstats
path: root/proto/ospf/dbdes.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-05-31 15:22:49 +0200
committerOndrej Filip <feela@network.cz>2004-05-31 15:22:49 +0200
commit781aa475aaa7503d4a86f0d4b8771cd027d30c04 (patch)
tree776c01f1436d3068e9f49e3955de52100a337364 /proto/ospf/dbdes.c
parentde259a41e3175d4080d5a33a39f0279308a25b56 (diff)
downloadbird-781aa475aaa7503d4a86f0d4b8771cd027d30c04.tar
bird-781aa475aaa7503d4a86f0d4b8771cd027d30c04.zip
Minor bug fix in neighbor state machine.
Diffstat (limited to 'proto/ospf/dbdes.c')
-rw-r--r--proto/ospf/dbdes.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c
index 03e010e..1f9dd55 100644
--- a/proto/ospf/dbdes.c
+++ b/proto/ospf/dbdes.c
@@ -39,6 +39,7 @@ 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);
@@ -55,6 +56,8 @@ 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)))
{
@@ -139,6 +142,7 @@ 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;
@@ -277,7 +281,7 @@ 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) &&
(ntohl(ps->ddseq)==n->ddr))
@@ -295,14 +299,14 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
if(ps->imms.bit.ms!=n->imms.bit.ms) /* M/S bit differs */
{
- DBG("SEQMIS-BIT-MS\n");
+ log("SEQMIS-BIT-MS\n");
ospf_neigh_sm(n, INM_SEQMIS);
break;
}
if(ps->imms.bit.i) /* I bit is set */
{
- DBG("SEQMIS-BIT-I\n");
+ log("SEQMIS-BIT-I\n");
ospf_neigh_sm(n, INM_SEQMIS);
break;
}
@@ -311,7 +315,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
if(ps->options!=n->options) /* Options differs */
{
- DBG("SEQMIS-OPT\n");
+ log("SEQMIS-OPT\n");
ospf_neigh_sm(n, INM_SEQMIS);
break;
}
@@ -320,7 +324,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
{
if(ntohl(ps->ddseq)!=n->dds) /* MASTER */
{
- DBG("SEQMIS-MASTER\n");
+ log("SEQMIS-MASTER\n");
ospf_neigh_sm(n, INM_SEQMIS);
break;
}
@@ -341,7 +345,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
{
if(ntohl(ps->ddseq)!=(n->dds+1)) /* SLAVE */
{
- DBG("SEQMIS-SLAVE\n");
+ log("SEQMIS-SLAVE\n");
ospf_neigh_sm(n, INM_SEQMIS);
break;
}
@@ -362,7 +366,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
}
else
{
- DBG("SEQMIS-FULL\n");
+ log("SEQMIS-FULL\n");
ospf_neigh_sm(n, INM_SEQMIS);
}
break;