Hi Pasi,

On to, 2014-07-03 at 15:14 +0300, pasi.sjoh...@jolla.com wrote:
> From: Pasi Sjöholm <pasi.sjoh...@jollamobile.com>
> 
> If domain_append is set and forward_dns_reply() processes the response
> for query without the domain name earlier than the response for one
> with the domain name set we need to make sure that the response is
> not sent back to the client if rcode and ancount are zero until the
> last nameserver response is processed.

This use case is not handled properly:

- there are multiple DNS servers defined, some of them from ISP, user
has also set his own DNS server that responds to some internal data
- user queries a host without domain name that is only found in his own
network
- all the ISP name servers return "not found"
- user's own dns server does not respond for some reason or the dns
reply is lost

What now happens is that the request timeouts and the user is given an
error instead of more proper "not found" result.


Cheers,
Jukka



> ---
>  src/dnsproxy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/dnsproxy.c b/src/dnsproxy.c
> index 7232b98..28e7cf7 100644
> --- a/src/dnsproxy.c
> +++ b/src/dnsproxy.c
> @@ -2068,7 +2068,8 @@ static int forward_dns_reply(unsigned char *reply, int 
> reply_len, int protocol,
>       }
>  
>  out:
> -     if (hdr->rcode > 0 && req->numresp < req->numserv)
> +     if ((hdr->rcode > 0 || (hdr->rcode == 0 && hdr->ancount == 0 &&
> +             req->append_domain)) && req->numresp < req->numserv)
>               return -EINVAL;
>  
>       request_list = g_slist_remove(request_list, req);


_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to