dnsproxy: send a response including queries 75/232175/1
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 29 Apr 2020 02:30:01 +0000 (11:30 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 29 Apr 2020 02:30:12 +0000 (11:30 +0900)
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

packaging/connman.spec
src/dnsproxy.c

index 3351c8d..4727649 100644 (file)
@@ -5,7 +5,7 @@
 
 Name:           connman
 Version:        1.37
-Release:        38
+Release:        39
 License:        GPL-2.0+
 Summary:        Connection Manager
 Url:            http://connman.net
index cb58325..b244a02 100755 (executable)
@@ -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));