diff options
| author | Martin Winter <mwinter@opensourcerouting.org> | 2019-10-04 15:19:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-04 15:19:17 +0200 |
| commit | 0c7f64c5cf612406cfd663615c9de270a43496db (patch) | |
| tree | 93b576914ad091685892ceadef21000fa5365395 /zebra/zebra_rib.c | |
| parent | 819f9825900511e5db6ed4163e0a07cbe80aff37 (diff) | |
| parent | 1f6a6e0700911aa6394a4dd7bb5e51493ae35a8e (diff) | |
Merge branch 'master' into ecmp_tests
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index f0601012b6..4a726b3e07 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3208,6 +3208,7 @@ static int rib_process_dplane_results(struct thread *thread) { struct zebra_dplane_ctx *ctx; struct dplane_ctx_q ctxlist; + bool shut_p = false; /* Dequeue a list of completed updates with one lock/unlock cycle */ @@ -3227,6 +3228,21 @@ static int rib_process_dplane_results(struct thread *thread) if (ctx == NULL) break; + /* If zebra is shutting down, avoid processing results, + * just drain the results queue. + */ + shut_p = atomic_load_explicit(&zrouter.in_shutdown, + memory_order_relaxed); + if (shut_p) { + while (ctx) { + dplane_ctx_fini(&ctx); + + ctx = dplane_ctx_dequeue(&ctxlist); + } + + continue; + } + while (ctx) { switch (dplane_ctx_get_op(ctx)) { case DPLANE_OP_ROUTE_INSTALL: |
