summaryrefslogtreecommitdiff
path: root/proto/bgp
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-07 13:54:20 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-08 15:24:02 +0200
commitfb7fb6744582b2bb74b3b1e32696bd5534e93054 (patch)
treea5b6d0bf41556edc242bd5dbf8d0aaf96af66ae1 /proto/bgp
parenta42877b9bf09c4c042bced3910ade9b71ce3724c (diff)
Table access is now locked.
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/attrs.c15
-rw-r--r--proto/bgp/bgp.h2
2 files changed, 14 insertions, 3 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index dcced164..bfdd9ac5 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1981,9 +1981,20 @@ bgp_out_table_export_start(struct rt_exporter *re, struct rt_export_request *req
rt_init_export(re, req->hook);
}
+static void
+bgp_out_table_export_done(void *data)
+{
+ struct bgp_out_export_hook *hook = data;
+ struct rt_export_request *req = hook->h.req;
+ void (*stopped)(struct rt_export_request *) = hook->h.stopped;
+
+ rt_export_stopped(&hook->h);
+ CALL(stopped, req);
+}
+
static const struct rt_exporter_class bgp_out_table_export_class = {
.start = bgp_out_table_export_start,
- .done = rt_export_stopped,
+ .done = bgp_out_table_export_done,
};
void
@@ -2519,7 +2530,7 @@ use_deterministic_med(struct rte_storage *r)
}
int
-bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best)
+bgp_rte_recalculate(struct rtable_private *table, net *net, rte *new, rte *old, rte *old_best)
{
rte *key = new ? new : old;
u32 lpref = rt_get_preference(key);
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index 0cd327a2..1bcfb915 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -599,7 +599,7 @@ void bgp_done_prefix(struct bgp_channel *c, struct bgp_prefix *px, struct bgp_bu
int bgp_rte_better(struct rte *, struct rte *);
int bgp_rte_mergable(rte *pri, rte *sec);
-int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best);
+int bgp_rte_recalculate(struct rtable_private *table, net *net, rte *new, rte *old, rte *old_best);
void bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt_pending_export *rpe UNUSED, rte **feed, uint count);
u32 bgp_rte_igp_metric(const rte *);
void bgp_rt_notify(struct proto *P, struct channel *C, const net_addr *n, rte *new, const rte *old);