X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=RW4rLYb4FQiNByaqQsUUbbb89b5xjP/eTNJdcMrwililxIr0mYrx9 3acxJ2UXUOzQgKJ5KyTji63euaWm3n2NmkvEVKaqSvmVY3PLb1rEkt6Y4150QJ6C U7GPe45SqCNG75LlOeaxZ0g66VSZgvLW9FZfvUCr1fZQ4ZKtt6cWNE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=DzXD8+NFGH0uO2i0bETNcZ/HwTc=; b=L4KfzT2mmXO+ieWe3PjDFhwcvlZR kJ92CNovGoWT+0IGmG4zDUFGDAqN9HKWYAgexpVns722QLVN95iYPl8tvLN6eLuR zVrBLMZzUKLyu9p9m6xP6FznytYYwQa/F/sUSx3tJSeFWCsqT2lMW1CfD6k4pXB8 FtzQYj8t6MjuTXA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Thu, 8 Jan 2015 14:23:53 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Resolving localhost on Windows 7 (for exim) Message-ID: <20150108132353.GN4190@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <0NHP009ITJ361TD0 AT vms173009 DOT mailsrvcs DOT net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l7GkBbkEatsaRqBf" Content-Disposition: inline In-Reply-To: <0NHP009ITJ361TD0@vms173009.mailsrvcs.net> User-Agent: Mutt/1.5.23 (2014-03-12) --l7GkBbkEatsaRqBf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Pierre, On Jan 5 09:03, Pierre A. Humblet wrote: > While porting exim to Windows 64 I have observed strange results when > resolving localhost >=20 > On Windows XP, >=20 > Resolv: search "localhost" type 28 > Resolv: query "localhost" type 28 > Resolv: DnsQuery: 0 (Windows) > Resolv: localhost Section 0 Type 28 Windows Record Length 16 > 08:02:06 3760 DNS lookup of localhost (AAAA) succeeded > Resolv: search "localhost" type 1 > Resolv: query "localhost" type 1 > Resolv: DnsQuery: 0 (Windows) > Resolv: localhost Section 1 Type 1 Windows Record Length 4 > 08:44:13 5552 DNS lookup of localhost (A) succeeded >=20 > We see that for IPV4 localhost things are fine. > Windows returns an answer section (1) and Cygwin processes it correctly. >=20 > However for IPV6 it returned a question section (0) but with data in it. > Cygwin essentially drops that. > That's why above the application tried an A record after getting the AAAA > record, which was empty. >=20 >=20 > However of Windows 7 > CYGWIN_NT-6.1 Dell3020 1.7.33-2(0.280/5/3) 2014-11-13 15:47 x86_64 Cygwin >=20 > Resolv: search "localhost" type 28 > Resolv: query "localhost" type 28 > Resolv: DnsQuery: 0 (Windows) > Resolv: localhost Section 0 Type 28 Windows Record Length 16 > 08:22:24 140244 DNS lookup of localhost (AAAA) succeeded > Resolv: search "localhost" type 1 > Resolv: query "localhost" type 1 > Resolv: DnsQuery: 0 (Windows) > Resolv: localhost Section 0 Type 1 Windows Record Length 4 >=20 > We see that Windows returns question sections in both cases and localhost= is > never resolved. > From what I have seen Windows never returns question section in normal ca= ses > so I suggest > inserting the following on line 251 of minires-os-if.c, to essentially tu= rn > question sections > in answer sections (after while (rr) { ) >=20 > if ((rr->Flags.DW & 0x3) =3D=3D 0) { > DPRINTF(debug, "Got section 0 %s %d with data length %d\n", DomNa= me, > Type, rr->wDataLength); > if (rr->wDataLength > 0) > rr->Flags.DW |=3D 1; // Make it an answer section as ther= e is > data > } Can you please send at least a real patch? Without the formatting matching the surrounding code I'm totally unsure where to apply this code. A ChangeLog entry would be helpful as well. > It would be nice if this would be tried ASAP. > However I am not setup currently to build cygwin. It's not exactly tricky to set this up... > Occasionally I also see localhost queries fail. > I have not been able to pinpoint what causes that. >=20 > Resolv: search "localhost" type 28 > Resolv: query "localhost" type 28 > Resolv: DnsQuery: 9003 (Windows) > 08:00:14 145640 DNS lookup of localhost (AAAA) gave HOST_NOT_FOUND > 08:00:14 145640 returning DNS_NOMATCH > Resolv: search "localhost" type 1 > Resolv: query "localhost" type 1 > Resolv: DnsQuery: 9003 (Windows) >=20 >=20 > In light of RFC 6761 we should handle localhost in gethostbyname2, for bo= th > IP4 and IP6 > While we are at it we should also handle numerical domains w.x.y.z there. > That's less urgent, I can do that in the coming weeks. Cool, I'm looking forward to your patches! Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --l7GkBbkEatsaRqBf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUroTpAAoJEPU2Bp2uRE+gebcP/0vI4byAU7nd3hLcW5855yvS XPK+Wip2fH9bk8ILu5qXWaWyZvY89ML/In1h5NMpKQIj1lBiynBDoVbS5x6uQrur WMERV2xjSQusjkEvRX0FX8rRgTrhWIebORPSmUUN6p6+SW+8lFx7jhatreClhOdr WqaenYAYRvUs8LuQRT3zMWC+OkcQvxLk6XX174t5hl2Fa2dyRZ7gEs8mU2zc15Aj MqzEBDdcAFRBq211znzuNLNLu+30F6OgLU4ih6VuZx/gtTBjZM8hl9mwv8kwNnbg 0+LqD2Vg4GTozVwRNeCE9bci2uvb2BH0kovoJuQ05iIK9NFZbe4dWYa+owe0UJlM iem4nOdzi9VVNWc4xy2Wq9Q9OeIG3CXfX5uI20hKgAM9hpTGpUWU3rqoGWxqteSN qa72X/juUgEEGmKQLVsesVvq0jTGCo7uZpT/na2r570pylNvta9RXlzbM+eKNfFB ofCqoxpoENIZKj5Df9eo7289yaGjNv1KvJDJ9uUgdWFA72755DjH6G7jndEOnUW/ pmHFXoCrl3AQ7yUFIAmA4ugaT50j5zriW/QKYeGIGFIsE+vCruqQ59aDtlEW2eFl l7jIlLd9M8zcIFu403dqWG9d1OMbBfy46sPXWb9yxX66Wg7EovJgM+CTBfq7BPSV y2FtSAFEsCarBkUYZCyh =l/wh -----END PGP SIGNATURE----- --l7GkBbkEatsaRqBf--