From: Samuel Ortiz Date: Thu, 17 Feb 2011 00:09:52 +0000 (+0100) Subject: dnsproxy: Add domains to the query only when it has no dot X-Git-Tag: 2.0_alpha~1718 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49c570129806b102596572f4d27a29ccfd6ab492;p=framework%2Fconnectivity%2Fconnman.git dnsproxy: Add domains to the query only when it has no dot --- diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 201c365..0b2ff22 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -317,6 +317,7 @@ static int ns_resolv(struct server_data *server, struct request_data *req, { GList *list; int sk, err; + char *dot, *lookup = (char *) name; sk = g_io_channel_unix_get_fd(server->channel); @@ -324,6 +325,11 @@ static int ns_resolv(struct server_data *server, struct request_data *req, req->numserv++; + /* If we have more than one dot, we don't add domains */ + dot = strchr(lookup, '.'); + if (dot != NULL && dot != lookup + strlen(lookup) - 1) + return 0; + for (list = server->domains; list; list = list->next) { char *domain; unsigned char alt[1024];