This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getnameinfo from glibc 2.1.94
Artur Frysiak <wiget@pld.org.pl> writes:
> # ltrace netstat 2>&1|grep getnameinfo
> getnameinfo(0xbfffd284, 24, 0x0805d4a0, 255, 0) = -1
> fprintf(0x002359a0, "getnameinfo: %s\n", "Bad value for ai_flags"getnameinfo: Bad value for ai_flags
>
> If I use netstat compiled with glibc 2.1.94 then all is fine.
> # ltrace netstat 2>&1|grep getnameinfo
> getnameinfo(0xbfffd280, 28, 0x0805c1e0, 255, 0) = 0
> getnameinfo(0xbfffd280, 28, 0x0805c1e0, 255, 0) = 0
The immediate reason for the problem you see is that the sockaddr_in6
structure changed. Complain the the appropriate working group, they
added an sin6_scope_id field. getnameinfo() tests for the size of the
passed-in address structure (the second parameter marks the size) and
fails if it is too small. You will have to recompile all IPv6 enabled
programs. I'll add a comment about this in the documentation.
But there is another strange things here: why is the program using
gai_strerror to report getnameinfo problems? This is why you see such
a strange error message.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------