summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-12-23 23:03:26 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-01-03 16:30:27 +0100
commitf8aad5d5b7601d0500841e57bafa5796cc3156ab (patch)
tree703d8427637c7e7209978816b6f19e829f69adc0 /proto/bgp/bgp.c
parent256cc8ee0867d7f5314d3a3d7db5429d2bf16b4e (diff)
Minor cleanups
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 5df2e38d..83c16889 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -524,9 +524,13 @@ bgp_conn_enter_established_state(struct bgp_conn *conn)
c->add_path_rx = (loc->add_path & BGP_ADD_PATH_RX) && (rem->add_path & BGP_ADD_PATH_TX);
c->add_path_tx = (loc->add_path & BGP_ADD_PATH_TX) && (rem->add_path & BGP_ADD_PATH_RX);
- // XXXX reset back to non-ANY?
+ /* Update RA mode */
if (c->add_path_tx)
c->c.ra_mode = RA_ANY;
+ else if (c->cf->secondary)
+ c->c.ra_mode = RA_ACCEPTED;
+ else
+ c->c.ra_mode = RA_OPTIMAL;
}
p->afi_map = mb_alloc(p->p.pool, num * sizeof(u32));
@@ -1411,8 +1415,6 @@ bgp_channel_init(struct channel *C, struct channel_config *CF)
struct bgp_channel *c = (void *) C;
struct bgp_channel_config *cf = (void *) CF;
- C->ra_mode = cf->secondary ? RA_ACCEPTED : RA_OPTIMAL;
-
c->cf = cf;
c->afi = cf->afi;
c->desc = bgp_get_af_desc(c->afi);