1833641 Members
3680 Online
110062 Solutions
New Discussion

IPv6 problem

 
Asya
Regular Advisor

IPv6 problem

Hi,

I'm running: "HP-UX glade B.11.11 U 9000/800 unknown"

This is from one of our developers..his code:

------SNIP---------------
I can look up IPv6 names with getaddrinfo(), but getnameinfo() is
failing. This C++ test program:

#include
#include
#include
#include

int main (int argc, char**argv) {
sockaddr_in6 sin6;
int err = inet_pton (AF_INET6,
"2001:470:1f00:1056:202:b3ff:fe1d:b515",
&sin6.sin6_addr);
printf ("inet_pton() returned %d\n", err);

sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons(0);
sin6.sin6_flowinfo = 0;
sin6.sin6_scope_id = 0;

char hostbuf[NI_MAXHOST];
int flags = NI_NAMEREQD;
err = getnameinfo (reinterpret_cast(&sin6),
sizeof (sin6),
hostbuf,
sizeof (hostbuf),
0,
0,
flags);

printf ("getnameinfo() returned %d (%s)\n", err, gai_strerror
(err));

}

prints:

inet_pton() returned 1
getnameinfo() returned 8 (host nor service provided, or not known)

------SNIP---------------

The address translates fine from the command line:

glade:test$ nslookup -type=ptr
5.1.5.b.d.1.e.f.f.f.3.b.2.0.2.0.6.5.0.1.0.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa.
Using /etc/hosts on: ginger

looking up FILES
Trying DNS
Non-authoritative answer:
5.1.5.b.d.1.e.f.f.f.3.b.2.0.2.0.6.5.0.1.0.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa
name = kohaku.sarna.org

nsswitch.conf - ipnodes: dns [NOTFOUND=return] files

This works on solaris and linux boxes that are connected through the same router.

What else can i check? /etc/hosts has ginger's ipv6 address....

Thank you,
Asya
2 REPLIES 2
Asya
Regular Advisor

Re: IPv6 problem

sorry..nslookup was done on ginger, not glade.
rick jones
Honored Contributor

Re: IPv6 problem

On the off chance that getnameinfo() is looking in a file other than /etc/hosts you might try tusc'ing your test program.
there is no rest for the wicked yet the virtuous have no pillows