]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix bug in ADD_PATH
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 11 Mar 2017 15:21:28 +0000 (16:21 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 14 Mar 2017 11:56:12 +0000 (12:56 +0100)
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

proto/bgp/packets.c

index d100b7d02ec76bdb92263fb62ae9d3858bf65bfe..ab87bdcc6d0438cf6a223844388c189ad44b04f1 100644 (file)
@@ -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);