This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: family independ functions
On Mon, 26 Jul 1999, Ulrich Drepper wrote:
> Arkadiusz Mi?kiewicz <misiek@misiek.eu.org> writes:
>
> > > No, they will be in 2.2.
> > :-(
>
> 2.1.x are bug fix releases.
missing functions for me == bug ;-)
> I'll take a look. It would be much easier if you could write a test
> program which I then also could add to the test suite. Should be
> fairly easy.
in attachmant...
This is result from KAME/IPv6 stack (2 and 26 are AF_INET and AF_INET6 families).
KAMEs getaddrinfo() doesn't support AF_UNIX ...
>>Should return family: 2. Returned: 2
>>Should return family: 24. Returned: 24
while on buggy glibcs getaddrinfo() it returns:
Should return family: 2. Returned: 10
Should return family: 2. Returned: 2
Should return family: 10. Returned: 10
Should return family: 10. Returned: 2
Should return family: 1. Returned: 1
Should return family: 3. Returned: 1
it even returns PF_AX25 :-) (my kernel doesn't have AX25 compiled in)
> --
> ---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
> Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
> Cygnus Solutions `--' drepper at cygnus.com `------------------------
--
arkadiusz miśkiewicz [misiek@misiek.eu.org]
[P]olish [L]inux [D]istribution with IPv6 support
http://www.ipv6.pld.org.pl/ http://www.pld.org.pl/
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
int main()
{
int gaierr, index;
int family[3] = { AF_INET, AF_INET6, AF_UNIX };
struct addrinfo hints, *ai, *aitop;
char straddr[INET6_ADDRSTRLEN], strport[16];
for (index=0; index <= 3; index++) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = family[index];
hints.ai_socktype = SOCK_STREAM;
if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
(void)gai_strerror(gaierr);
}
for (ai = aitop; ai; ai = ai->ai_next) {
printf("Should return family: %d. Returned: %d\n", family[index], ai->ai_family);
}
}
}