diff options
author | Maria Matejka <mq@ucw.cz> | 2023-02-07 17:01:34 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-04 17:00:58 +0200 |
commit | e565e045b6be0deae5c55bd3ae64fc1909a0a873 (patch) | |
tree | 08892d0daba7050413d29ee0d7c2d9e4cd4eadc8 /nest | |
parent | 227352c4611a9024c93b22c94c7bbd9ac474effe (diff) |
Flowspec links must have the destination table service loop locked
Diffstat (limited to 'nest')
-rw-r--r-- | nest/rt-table.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index fce51662..bd7cb259 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2677,6 +2677,8 @@ rt_flowspec_link(rtable *src_pub, rtable *dst_pub) int lock_dst = 0; + birdloop_enter(dst_pub->loop); + RT_LOCKED(src_pub, src) { struct rt_flowspec_link *ln = rt_flowspec_find_link(src, dst_pub); @@ -2689,7 +2691,7 @@ rt_flowspec_link(rtable *src_pub, rtable *dst_pub) ln->dst = dst_pub; ln->req = (struct rt_export_request) { .name = mb_sprintf(p, "%s.flowspec.notifier", dst_pub->name), - .list = &global_work_list, + .list = birdloop_event_list(dst_pub->loop), .trace_routes = src->config->debug, .dump_req = rt_flowspec_dump_req, .log_state_change = rt_flowspec_log_state_change, @@ -2706,6 +2708,8 @@ rt_flowspec_link(rtable *src_pub, rtable *dst_pub) if (lock_dst) rt_lock_table(dst_pub); + + birdloop_leave(dst_pub->loop); } static void @@ -2721,6 +2725,8 @@ rt_flowspec_link_stopped(struct rt_export_request *req) void rt_flowspec_unlink(rtable *src, rtable *dst) { + birdloop_enter(dst->loop); + struct rt_flowspec_link *ln; RT_LOCKED(src, t) { @@ -2731,6 +2737,8 @@ rt_flowspec_unlink(rtable *src, rtable *dst) if (!--ln->uc) rt_stop_export(&ln->req, rt_flowspec_link_stopped); } + + birdloop_leave(dst->loop); } static void |