Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: test for network libraries (for test only)/problems with name resolution

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

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.


Messages sorted by: Reverse Date, Date, Thread, Author