0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

fixup! fixup! BGP runs TX as a deferred routine

This commit is contained in:
Maria Matejka 2024-06-27 13:34:22 +02:00
parent 24dfee88a2
commit 235ec45954
2 changed files with 29 additions and 23 deletions

View File

@ -1840,11 +1840,12 @@ bgp_done_prefix(struct bgp_ptx_private *c, struct bgp_prefix *px, struct bgp_buc
void void
bgp_tx_resend(struct bgp_proto *p, struct bgp_channel *bc) bgp_tx_resend(struct bgp_proto *p, struct bgp_channel *bc)
{
uint seen = 0;
{ {
BGP_PTX_LOCK(bc->tx, c); BGP_PTX_LOCK(bc->tx, c);
ASSERT_DIE(bc->tx_keep); ASSERT_DIE(bc->tx_keep);
uint seen = 0;
HASH_WALK(c->prefix_hash, next, px) HASH_WALK(c->prefix_hash, next, px)
{ {
@ -1867,6 +1868,7 @@ bgp_tx_resend(struct bgp_proto *p, struct bgp_channel *bc)
log(L_TRACE "%s.%s: TX resending %u routes", log(L_TRACE "%s.%s: TX resending %u routes",
bc->c.proto->name, bc->c.name, seen); bc->c.proto->name, bc->c.name, seen);
}
if (seen) if (seen)
bgp_schedule_packet(p->conn, bc, PKT_UPDATE); bgp_schedule_packet(p->conn, bc, PKT_UPDATE);
} }

View File

@ -1052,10 +1052,13 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, uint len)
conn->hold_time, conn->keepalive_time, p->remote_as, p->remote_id, conn->as4_session); conn->hold_time, conn->keepalive_time, p->remote_as, p->remote_id, conn->as4_session);
bgp_schedule_packet(conn, NULL, PKT_KEEPALIVE); bgp_schedule_packet(conn, NULL, PKT_KEEPALIVE);
if (conn->sk)
{
bgp_start_timer(p, conn->hold_timer, conn->hold_time); bgp_start_timer(p, conn->hold_timer, conn->hold_time);
bgp_start_timer(p, conn->send_hold_timer, conn->send_hold_time); bgp_start_timer(p, conn->send_hold_timer, conn->send_hold_time);
bgp_conn_enter_openconfirm_state(conn); bgp_conn_enter_openconfirm_state(conn);
} }
}
/* /*
@ -3186,7 +3189,8 @@ bgp_schedule_packet(struct bgp_conn *conn, struct bgp_channel *c, int type)
if (was_active || (conn->sk->tpos != conn->sk->tbuf)) if (was_active || (conn->sk->tpos != conn->sk->tbuf))
return; return;
else if ((type == PKT_KEEPALIVE) || (this_birdloop != p->p.loop)) else if ((type == PKT_KEEPALIVE) || (this_birdloop != p->p.loop))
bgp_fire_tx(conn); while (bgp_fire_tx(conn) > 0)
;
else else
{ {
struct bgp_tx_deferred_call btdc = { struct bgp_tx_deferred_call btdc = {