summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-03-08 13:44:18 +0100
committerMaria Matejka <mq@ucw.cz>2023-04-04 17:00:58 +0200
commit90de93ca0336b95038dddaef276d0c7ae5b7bbff (patch)
tree82dfda0d44cb5b84fa46762c0bf0104859a84b16 /proto
parent97d2875e999487bfe91f16c77c409ac0080541d3 (diff)
Fixed unwanted reloads while reconfiguring protocols with import table on
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/bgp.c14
-rw-r--r--proto/bgp/config.Y3
2 files changed, 9 insertions, 8 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 26fccdc3..851167b6 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -651,7 +651,7 @@ bgp_conn_enter_established_state(struct bgp_conn *conn)
int active = loc->ready && rem->ready;
c->c.disabled = !active;
- c->c.reloadable = p->route_refresh || c->cf->import_table;
+ c->c.reloadable = p->route_refresh || ((c->c.in_keep & RIK_PREFILTER) == RIK_PREFILTER);
c->index = active ? num++ : 0;
@@ -1868,9 +1868,6 @@ bgp_channel_start(struct channel *C)
c->pool = p->p.pool; // XXXX
- if (c->cf->import_table)
- channel_setup_in_table(C);
-
if (c->cf->export_table)
bgp_setup_out_table(c);
@@ -2283,7 +2280,6 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
(new->llgr_time != old->llgr_time) ||
(new->ext_next_hop != old->ext_next_hop) ||
(new->add_path != old->add_path) ||
- (new->import_table != old->import_table) ||
(new->export_table != old->export_table) ||
(TABLE(new, igp_table_ip4) != TABLE(old, igp_table_ip4)) ||
(TABLE(new, igp_table_ip6) != TABLE(old, igp_table_ip6)) ||
@@ -2298,11 +2294,13 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
(new->aigp != old->aigp) ||
(new->cost != old->cost))
{
- /* import_changed itself does not force ROUTE_REFRESH when import_table is active */
- if ((c->c.in_keep & RIK_PREFILTER) && (c->c.channel_state == CS_UP))
+ /* If import table is active and route refresh is possible, we just ask for route refresh */
+ if ((c->c.in_keep & RIK_PREFILTER) && (c->c.channel_state == CS_UP) && p->route_refresh)
bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);
- *import_changed = 1;
+ /* Otherwise we do complete reload */
+ else
+ *import_changed = 1;
}
if (!ipa_equal(new->next_hop_addr, old->next_hop_addr) ||
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index 66d97e3b..a51c82bd 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -329,6 +329,9 @@ bgp_channel_end:
if (!this_channel->table)
cf_error("Routing table not specified");
+ if (BGP_CC->import_table)
+ this_channel->in_keep |= RIK_PREFILTER;
+
this_channel = NULL;
};