[PATCH] dnsproxy: Use TCP connections only for the intended request

patrik.flykt at linux.intel.com patrik.flykt at linux.intel.com
Fri Nov 16 05:08:38 PST 2012


From: Patrik Flykt <patrik.flykt at linux.intel.com>

The DNS proxy code creates and uses a TCP connection only for a single
request at a time. The 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 for the initial request. Any
other requests sent over the connection will silently disappear, thus
add a check to ignore TCP connection for the generic DNS lookup case.
---
 src/dnsproxy.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index ba2dfaa..25cdfd4 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2221,6 +2221,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)
-- 
1.7.10.4




More information about the connman mailing list