From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6831 invoked from network); 8 Sep 2000 20:31:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Sep 2000 20:31:54 -0000 Received: (qmail 26257 invoked by alias); 8 Sep 2000 20:31:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12780 Received: (qmail 26249 invoked from network); 8 Sep 2000 20:31:44 -0000 Subject: Re: PATCH: test for network libraries (for test only)/problems with name resolution In-Reply-To: <000001c0195a$b9945130$21c9ca95@mow.siemens.ru> from Andrej Borsenkow at "Sep 8, 2000 10:05:01 am" To: Andrej Borsenkow Date: Fri, 8 Sep 2000 21:31:56 +0100 (BST) CC: Bart Schaefer , Will Day , ZSH workers mailing list X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: From: Zefram Andrej Borsenkow wrote: >what I was about to do - remove all local (re-)definitions of resolver >functions and make better guess about SUPORT_IPV6, i.e. do not use IPv6 >functions unless we are doing IPv6 and do not do IPv6 unless we have all >prerequisites. The point of having the code define getipnodebyname() etc. is so that the main code (that's actually doing networky stuff) only needs to know about getipnodebyname(). If the local library provides a real getipnodebyname() then we use that, getting proper IPv6 support is the OS supports it; otherwise we use the fallback definition in zftp.c that only provides support for IPv4 (which must be all the local library supports). Actually it's one stop more complicated than that, because of the intermediate fallback of the older gethostbyname2() interface, which also supports IPv6 and may or may not exist on each system. The main code doesn't need to know which subset of the three name lookup interfaces (getipnodebyname(), gethostbyname2(), gethostbyname()) is actually supported -- it just uses the most capable one, getipnodebyname(), and we make sure that that does exist one way or another. The same goes for inet_ntop() etc. There does seem to be a problem with the internal gethostbyname2() clashing with an external declaration. The right solution for this is to declare and define a my_gethostbyname2() for the fallback definition, and add a "#define gethostbyname2 my_gethostbyname2" inside the #ifndef section that defines it. -zefram