summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-03-11 16:21:28 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-03-14 12:56:12 +0100
commit27f6ba651ebb07201f7964c8f14a254267f0f26a (patch)
tree023a1afceee21aa1cb4d806e62a8ac3435be4dbe /proto/bgp/packets.c
parent1950a479c020d1972b6007d8ea0f66e3d4f8564a (diff)
BGP: Fix bug in ADD_PATH
When a BGP session with ADD_PATH is restarted and the neighbor do not announce ADD_PATH capability during reconnect, the accept_ra_types is still set to RA_ANY. Thanks to Lennert Buytenhek for the bugreport
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index d100b7d0..ab87bdcc 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1037,8 +1037,13 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, uint len)
p->gr_ready = p->cf->gr_mode && conn->peer_gr_able;
p->ext_messages = p->cf->enable_extended_messages && conn->peer_ext_messages_support;
+ /* Update RA mode */
if (p->add_path_tx)
p->p.accept_ra_types = RA_ANY;
+ else if (p->cf->secondary)
+ p->p.accept_ra_types = RA_ACCEPTED;
+ else
+ p->p.accept_ra_types = RA_OPTIMAL;
DBG("BGP: Hold timer set to %d, keepalive to %d, AS to %d, ID to %x, AS4 session to %d\n", conn->hold_time, conn->keepalive_time, p->remote_as, p->remote_id, p->as4_session);