From 4e82877e37cce1f02ceacc250910edb094fdc395 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 16 Nov 2012 14:32:58 +0200 Subject: [PATCH] dnsproxy: Use TCP connections only for the intended request The DNS proxy code creates and uses a TCP connection only for a single request at a time. A TCP DNS proxy is added to the end of the server list, but should not be used for generic requests as the connection will be closed down after the response to the initial request. Any other requests sent over the connection will silently disappear. Add a check to ignore TCP DNS servers for generic lookups. --- src/dnsproxy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 7de4e389..df1f6d26 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -2224,6 +2224,11 @@ static gboolean resolv(struct request_data *req, for (list = server_list; list; list = list->next) { struct server_data *data = list->data; + if (data->protocol == IPPROTO_TCP) { + DBG("server %s ignored proto TCP", data->server); + continue; + } + DBG("server %s enabled %d", data->server, data->enabled); if (data->enabled == FALSE) -- 2.34.1