Commit dfc3a5b5 authored by Daniel Salzman's avatar Daniel Salzman

nameserver: cover conf access with rcu lock

parent 7a8d9e10
...@@ -450,12 +450,13 @@ static int ratelimit_apply(int state, knot_pkt_t *pkt, knot_layer_t *ctx) ...@@ -450,12 +450,13 @@ static int ratelimit_apply(int state, knot_pkt_t *pkt, knot_layer_t *ctx)
static int process_query_out(knot_layer_t *ctx, knot_pkt_t *pkt) static int process_query_out(knot_layer_t *ctx, knot_pkt_t *pkt)
{ {
assert(pkt && ctx); assert(pkt && ctx);
rcu_read_lock();
struct query_data *qdata = QUERY_DATA(ctx); struct query_data *qdata = QUERY_DATA(ctx);
struct query_plan *plan = conf()->query_plan; struct query_plan *plan = conf()->query_plan;
struct query_step *step = NULL; struct query_step *step = NULL;
rcu_read_lock();
/* Check parse state. */ /* Check parse state. */
knot_pkt_t *query = qdata->query; knot_pkt_t *query = qdata->query;
int next_state = KNOT_STATE_PRODUCE; int next_state = KNOT_STATE_PRODUCE;
...@@ -553,6 +554,7 @@ finish: ...@@ -553,6 +554,7 @@ finish:
} }
rcu_read_unlock(); rcu_read_unlock();
return next_state; return next_state;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment