mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
OSPF: Reject duplicate DBDES packets after dead interval
Master may free last DBDES packet immediately. Slave must wait dead interval before freeing last DBDES packet and then reject duplicate DBDES packets with SeqNumberMismatch.
This commit is contained in:
parent
bf402c61e6
commit
99b2d10be0
@ -235,6 +235,14 @@ ospf_rxmt_dbdes(struct ospf_proto *p, struct ospf_neighbor *n)
|
|||||||
ospf_do_send_dbdes(p, n);
|
ospf_do_send_dbdes(p, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ospf_reset_ldd(struct ospf_proto *p UNUSED, struct ospf_neighbor *n)
|
||||||
|
{
|
||||||
|
mb_free(n->ldd_buffer);
|
||||||
|
n->ldd_buffer = NULL;
|
||||||
|
n->ldd_bsize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ospf_process_dbdes(struct ospf_proto *p, struct ospf_packet *pkt, struct ospf_neighbor *n)
|
ospf_process_dbdes(struct ospf_proto *p, struct ospf_packet *pkt, struct ospf_neighbor *n)
|
||||||
{
|
{
|
||||||
@ -433,6 +441,7 @@ ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa,
|
|||||||
if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
|
if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
|
||||||
{
|
{
|
||||||
tm_stop(n->dbdes_timer);
|
tm_stop(n->dbdes_timer);
|
||||||
|
ospf_reset_ldd(p, n);
|
||||||
ospf_neigh_sm(n, INM_EXDONE);
|
ospf_neigh_sm(n, INM_EXDONE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -456,7 +465,11 @@ ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa,
|
|||||||
ospf_send_dbdes(p, n);
|
ospf_send_dbdes(p, n);
|
||||||
|
|
||||||
if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
|
if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
|
||||||
|
{
|
||||||
|
/* Use dbdes timer to postpone freeing of Last DBDES packet buffer */
|
||||||
|
tm_start(n->dbdes_timer, n->ifa->deadint S);
|
||||||
ospf_neigh_sm(n, INM_EXDONE);
|
ospf_neigh_sm(n, INM_EXDONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -610,6 +610,12 @@ dbdes_timer_hook(timer *t)
|
|||||||
|
|
||||||
if ((n->state == NEIGHBOR_EXCHANGE) && (n->myimms & DBDES_MS))
|
if ((n->state == NEIGHBOR_EXCHANGE) && (n->myimms & DBDES_MS))
|
||||||
ospf_rxmt_dbdes(p, n);
|
ospf_rxmt_dbdes(p, n);
|
||||||
|
|
||||||
|
if ((n->state > NEIGHBOR_LOADING) && !(n->myimms & DBDES_MS))
|
||||||
|
{
|
||||||
|
ospf_reset_ldd(p, n);
|
||||||
|
tm_stop(n->dbdes_timer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -989,6 +989,7 @@ void ospf_receive_hello(struct ospf_packet *pkt, struct ospf_iface *ifa, struct
|
|||||||
/* dbdes.c */
|
/* dbdes.c */
|
||||||
void ospf_send_dbdes(struct ospf_proto *p, struct ospf_neighbor *n);
|
void ospf_send_dbdes(struct ospf_proto *p, struct ospf_neighbor *n);
|
||||||
void ospf_rxmt_dbdes(struct ospf_proto *p, struct ospf_neighbor *n);
|
void ospf_rxmt_dbdes(struct ospf_proto *p, struct ospf_neighbor *n);
|
||||||
|
void ospf_reset_ldd(struct ospf_proto *p, struct ospf_neighbor *n);
|
||||||
void ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa, struct ospf_neighbor *n);
|
void ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa, struct ospf_neighbor *n);
|
||||||
|
|
||||||
/* lsreq.c */
|
/* lsreq.c */
|
||||||
|
Loading…
Reference in New Issue
Block a user