summaryrefslogtreecommitdiff
path: root/src/dnsproxy.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-16 14:32:58 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-19 14:55:55 +0200
commit4e82877e37cce1f02ceacc250910edb094fdc395 (patch)
tree440bee720198ed9a2276661444f2f98aa12b3201 /src/dnsproxy.c
parentfabaea99c6a9587c79ec53510fcf32bd47cba68a (diff)
downloadconnman-4e82877e37cce1f02ceacc250910edb094fdc395.tar.gz
connman-4e82877e37cce1f02ceacc250910edb094fdc395.tar.bz2
connman-4e82877e37cce1f02ceacc250910edb094fdc395.zip
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.
Diffstat (limited to 'src/dnsproxy.c')
-rw-r--r--src/dnsproxy.c5
1 files changed, 5 insertions, 0 deletions
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)