diff --git a/daemon/lua/config.lua b/daemon/lua/config.lua index b8c61de13ac19ac1dcfb2289ae99d95dac5d8eae..a417a0b549d40713b294b2a0d4798b298eb10345 100644 --- a/daemon/lua/config.lua +++ b/daemon/lua/config.lua @@ -1,10 +1,11 @@ -- Listen on localhost if not next(net.list()) then - if not pcall(net.listen, '127.0.0.1') then - error('failed to bind to localhost#53') + local ok, err = pcall(net.listen, {'127.0.0.1', '::1'}) + if not ok then + error('bind to localhost#53 '..err) end end -- Open cache if not set/disabled if not cache.current_size then - cache.size = 10 * MB + cache.size = 100 * MB end \ No newline at end of file diff --git a/daemon/worker.c b/daemon/worker.c index 8872a0be3b330b8b7a25a4cf72d419a9e12ad37b..cb5dd83b9dc493b3f35483a4451f06b6897dbca8 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -443,14 +443,11 @@ static void on_connect(uv_connect_t *req, int status) struct qr_task *task = req->data; uv_stream_t *handle = req->handle; if (qr_valid_handle(task, (uv_handle_t *)req->handle)) { - struct sockaddr_in6 addr; - int addrlen = sizeof(addr); /* Retrieve endpoint IP for statistics */ - uv_tcp_getpeername((uv_tcp_t *)handle, (struct sockaddr *)&addr, &addrlen); if (status == 0) { - qr_task_send(task, (uv_handle_t *)handle, (struct sockaddr *)&addr, task->pktbuf); + qr_task_send(task, (uv_handle_t *)handle, NULL, task->pktbuf); } else { DEBUG_MSG("ioreq conn_done %p => %d, %s\n", req, status, uv_strerror(status)); - qr_task_step(task, (struct sockaddr *)&addr, NULL); + qr_task_step(task, task->addrlist, NULL); } } qr_task_unref(task);