Commit 5d666b04 authored by Marek Vavruša's avatar Marek Vavruša

lib/resolve: increased buflen to accomodate edns0/dnssec

parent 8d9fe9e3
......@@ -54,6 +54,7 @@ void udp_recv(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf,
uv_loop_t *loop = handle->loop;
struct worker_ctx *worker = loop->data;
knot_pkt_t *query = knot_pkt_new(buf->base, nread, worker->mm);
query->max_size = sizeof(worker->bufs.wire);
worker_exec(worker, (uv_handle_t *)handle, query, addr);
knot_pkt_free(&query);
}
......@@ -103,6 +104,7 @@ static void tcp_recv(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
}
knot_pkt_t *query = knot_pkt_new(buf->base + 2, nbytes, worker->mm);
query->max_size = sizeof(worker->bufs.wire);
worker_exec(worker, (uv_handle_t *)handle, query, NULL);
knot_pkt_free(&query);
}
......
......@@ -85,7 +85,7 @@ static struct qr_task *qr_task_create(struct worker_ctx *worker, uv_handle_t *ha
}
/* Create buffers */
knot_pkt_t *next_query = knot_pkt_new(NULL, KNOT_WIRE_MIN_PKTSIZE, &task->req.pool);
knot_pkt_t *next_query = knot_pkt_new(NULL, KNOT_EDNS_MAX_UDP_PAYLOAD, &task->req.pool);
knot_pkt_t *answer = knot_pkt_new(NULL, KNOT_WIRE_MAX_PKTSIZE, &task->req.pool);
if (!next_query || !answer) {
mp_delete(pool.ctx);
......
......@@ -141,7 +141,7 @@ int kr_resolve(struct kr_context* ctx, knot_pkt_t *answer,
/* Create memory pool */
mm_ctx_t pool;
mm_ctx_mempool(&pool, MM_DEFAULT_BLKSIZE);
knot_pkt_t *query = knot_pkt_new(NULL, KNOT_WIRE_MIN_PKTSIZE, &pool);
knot_pkt_t *query = knot_pkt_new(NULL, KNOT_EDNS_MAX_UDP_PAYLOAD, &pool);
knot_pkt_t *resp = knot_pkt_new(NULL, KNOT_WIRE_MAX_PKTSIZE, &pool);
if (!query || !resp) {
mp_delete(pool.ctx);
......
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