summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-01-18 14:11:32 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-18 16:48:58 +0200
commit049758a2c2316d2f3df22235c8965b2e525db4cc (patch)
tree1ab4f6dc0f73369ee3f59753a81945385376ee34 /src
parenta07312e3a052f409e4457e26b258119ef4084368 (diff)
downloadconnman-049758a2c2316d2f3df22235c8965b2e525db4cc.tar.gz
connman-049758a2c2316d2f3df22235c8965b2e525db4cc.tar.bz2
connman-049758a2c2316d2f3df22235c8965b2e525db4cc.zip
dnsproxy: DNS response answer count was incorrectly set
We set the answer count in host byte order instead of network byte order when sending cached AAAA record. This problem is only seen in special case when an AAAA record is generated by us when there is IPv4 address in cache but no IPv6 address for the host.
Diffstat (limited to 'src')
-rw-r--r--src/dnsproxy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index ce619095..f698cfde 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -1307,7 +1307,7 @@ static int cache_update(struct server_data *srv, unsigned char *msg,
return -ENOMEM;
data->inserted = entry->ipv4->inserted;
data->type = type;
- data->answers = hdr->ancount;
+ data->answers = ntohs(hdr->ancount);
data->timeout = entry->ipv4->timeout;
if (srv->protocol == IPPROTO_UDP)
cache_offset = 2;