/**
* ospf_dbdes_send - transmit database description packet
* @n: neighbor
+ * @next: whether to send a next packet in a sequence (1) or to retransmit the old one (0)
*
* Sending of a database description packet is described in 10.6 of RFC 2328.
* Reception of each packet is acknowledged in the sequence number of another.
* of the buffer.
*/
void
-ospf_dbdes_send(struct ospf_neighbor *n)
+ospf_dbdes_send(struct ospf_neighbor *n, int next)
{
struct ospf_dbdes_packet *pkt;
struct ospf_packet *op;
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)))
+ if (next)
{
- snode *sn; /* Send next */
+ snode *sn;
struct ospf_lsa_header *lsa;
pkt = n->ldbdes;
n->imms.byte = ps->imms.byte;
OSPF_TRACE(D_PACKETS, "I'm slave to %I.", n->ip);
ospf_neigh_sm(n, INM_NEGDONE);
- ospf_dbdes_send(n);
+ ospf_dbdes_send(n, 1);
break;
}
if (n->myimms.bit.ms == 0)
{
/* Slave should retransmit dbdes packet */
- ospf_dbdes_send(n);
+ ospf_dbdes_send(n, 0);
}
return;
}
}
else
{
- ospf_dbdes_send(n);
+ ospf_dbdes_send(n, 1);
}
}
n->ddr = ntohl(ps->ddseq);
n->dds = ntohl(ps->ddseq);
ospf_dbdes_reqladd(ps, n);
- ospf_dbdes_send(n);
+ ospf_dbdes_send(n, 1);
}
break;
if (n->myimms.bit.ms == 0)
{
/* Slave should retransmit dbdes packet */
- ospf_dbdes_send(n);
+ ospf_dbdes_send(n, 0);
}
return;
}
#ifndef _BIRD_OSPF_DBDES_H_
#define _BIRD_OSPF_DBDES_H_
-void ospf_dbdes_send(struct ospf_neighbor *n);
+void ospf_dbdes_send(struct ospf_neighbor *n, int next);
void ospf_dbdes_receive(struct ospf_dbdes_packet *ps,
struct ospf_iface *ifa, struct ospf_neighbor *n);