summaryrefslogtreecommitdiff
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
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
-rw-r--r--packaging/connman.spec2
-rwxr-xr-xsrc/dnsproxy.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/packaging/connman.spec b/packaging/connman.spec
index 3351c8d9..47276492 100644
--- a/packaging/connman.spec
+++ b/packaging/connman.spec
@@ -5,7 +5,7 @@
Name: connman
Version: 1.37
-Release: 38
+Release: 39
License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
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));