Description of problem: If I run either the dhcp6c client or the dhcp6s server it logs multiple messages saying calls to getnameinfo() are failing. eg # dhcp6s -c /etc/dhcp6s.conf -f Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Mar/25/2007 13:16:02 getnameinfo return error Or # dhcp6c -f ath0 Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Mar/25/2007 13:18:07 getnameinfo return error Version-Release number of selected component (if applicable): dhcpv6-0.10-32.fc6 How reproducible: Always Steps to Reproduce: 1. Start dhcp6s on a server 2. Start dhcp6c on a client 3. Wait for client to initiate request with server Actual results: Multiple messages about getnameinfo() failing are printed Expected results: No getnameinfo() calls fail Additional info: The code has a systematic error in the way it calls getnameinfo(). The man page documents the contract as int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); "The sa argument is a pointer to a generic socket address structure (of type sockaddr_in or sockaddr_in6) of size salen that holds the input IP address and port number." In other words salen should basically be sizeof(*sa). The dhcp6s/dhcp6c code, however, is nearly always passing in sizeof(*sa->sa_addr) which is too small. getnameinfo() checks the passed in salen and determines that the sa buffer is not large enough to hold the IPv6 address and so returns a fail code. There does not at first glance appear to be any operational ill-effects to the DHCP server/client, but it makes the debug logs from these two programs utterly useless because all the address info is missing.
Created attachment 150855 [details] Pass in correct salen values to getnameinfo() The attached patch fixes all the places which call getnameinfo() to pass in the correct value for salen - ie sizeof(*sa) instead of sizeof(sa->sa_addr)
Thanks for the patch. Included in dhcpv6-0.10-41.fc7.