Issues with getaddrinfo() apparently not working as expected.
I have an issue with cfservd, from the cfengine package not listening on both ipv4 and ipv6. Tracing through the source indicated that the issue was with the getaddrinfo() call. I have used the example code on the man page and can confirm that it doesn't work as expected on either Fedora 12, Fedora 10 or CentOS 5.3
The servers I am testing on have both ipv4 and ipv6 enabled and working. i.e. I can ssh to them using either -4 or -6 and netstat -a shows 0.0.0.0:22 and :::22
Running the example code on the Fedora servers results in only a single IPv4 address structure being returned by the getaddrinfo call and hence only listening on the one protocol. Strangely, on the CentOS server only the IPv6 address structure is returned.
I need both IPv4 and IPv6 for cfengine but am at a complete loss as to how to get it to work when the issue appears to be something fundamentally wrong at the OS level.
Any pointers much appreciated.