default tcp host

Daniel P. Berrange dan at berrange.com
Wed Jun 13 11:09:03 PDT 2007


On Wed, Jun 13, 2007 at 04:56:44PM -0400, Havoc Pennington wrote:
> Here is the patch I put in for this. Better ideas welcome.

The TCP stuff is pretty badly broken in the way it does lookups
using the legacy gethostbyname() functions. Its API contract does
not enable it to provide sorted results wrt to IPv4 & IPv6 - you
can only query one family at a time. DBus never asks for an address
family so its only getting IPv4 results and then only using the first
address returned anyway. So this is all going to behave rather badly 
in a multi-protocol environemnt. gethostbyname is also not in the 
slightest bit thread safe :-(

IMHO the whole lot needs to be rewritten & made to use getaddrinfo().
There's a very good coverage of how to do adddress lookup that
works correctly in a dual IPv4/IPv6 network environment at:

 http://people.redhat.com/drepper/userapi-ipv6.html

I've followed these guidelines for a few other apps & although it may
seem complex at first it works very well indeed in a dual IPv4/6 network
environment

I'd be willing to take a stab at it, but its not something I'll likely
have spare cycles for in short term. I'd certainly help any testing since
I'm running a fully connected IPv6 stack everywhere.

Regards,
Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070613/4481782a/attachment.pgp 


More information about the dbus mailing list