summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2020-04-29 11:30:01 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2020-04-29 11:30:12 +0900
commit2b88c43eaf88a11793496ea840d33407603113e1 (patch)
treecb2c526768d8734a2021837757c6c3b62f9b6024 /src
parent5d602b3212b4d107bd8706357c89e79ebbcf0e70 (diff)
downloadconnman-2b88c43eaf88a11793496ea840d33407603113e1.tar.gz
connman-2b88c43eaf88a11793496ea840d33407603113e1.tar.bz2
connman-2b88c43eaf88a11793496ea840d33407603113e1.zip
dnsproxy: send a response including queries
This is revert patch of https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=d74bb4a97224b6382ae2f542fe3751b1904e9b2e Some DNS API checks a query field of DNS response to verify the response. So, DNS resolving delay is often caused in case of DNS error. This patch makes dnsproxy send the 'whole' packet. Change-Id: I21cd0d86ef132d8c1eadbf93e192187112191326
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dnsproxy.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index cb583251..b244a02e 100755
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -510,22 +510,30 @@ static void send_response(int sk, unsigned char *buf, size_t len,
return;
hdr = (void *) (buf + offset);
+#if !defined TIZEN_EXT
if (offset) {
buf[0] = 0;
buf[1] = sizeof(*hdr);
}
+#endif
debug("id 0x%04x qr %d opcode %d", hdr->id, hdr->qr, hdr->opcode);
hdr->qr = 1;
hdr->rcode = ns_r_servfail;
+#if !defined TIZEN_EXT
hdr->qdcount = 0;
+#endif
hdr->ancount = 0;
hdr->nscount = 0;
hdr->arcount = 0;
+#if defined TIZEN_EXT
+ err = sendto(sk, buf, len, MSG_NOSIGNAL, to, tolen);
+#else
err = sendto(sk, buf, sizeof(*hdr) + offset, MSG_NOSIGNAL, to, tolen);
+#endif
if (err < 0) {
connman_error("Failed to send DNS response to %d: %s",
sk, strerror(errno));