default tcp host

Havoc Pennington hp at
Fri Jun 15 09:40:06 PDT 2007


Daniel P. Berrange wrote:
> We basically have the situation where there's no way to reliably figure
> out what hostname we should advertise to non-local clients. So for 
> Havoc's use case of advertising DBus daemon via Avahi we definitely
> need the administrator to define the hostname advertized as part of
> the address.

For the Avahi case it's not so necessary because when something locates 
a service using Avahi, they already have a hostname and port. The thing 
that's tricky in the Avahi case is that the listening server doesn't 
really know what network interfaces Avahi will use for advertising - you 
can tell Avahi to use INADDR_ANY, or you can specify an interface to 
advertise on by "AvahiIfIndex" (I can't find in the Avahi docs what this 
index is or how to pick it).

Anyway, so it's necessary to either tell libdbus to use INADDR_ANY, or 
tell it to use some specific interface and somehow figure out which 
AvahiIfIndex that would correspond to. INADDR_ANY is much simpler obviously.

> Another option is to have a separate some separate XML element where you
> detail what hostnames to advertise <advertise></advertise>
> if no explicit host is provided (the INADDR_ANY case).
> Or perhaps add an extra field to the <listen> tag listing hostnames
> that should be used after binding. eg. So some example <listen> tags 
> and the corresponding output by --print-address

Something along the lines of your suggestions here is probably right. I 
think the default bind should probably be INADDR_ANY and the default 
advertise should probably be localhost, with both possible to override 

There is some back compat concern though, and right now the address 
format is screwy where host is overloaded to be both the bind and the 

We could introduce bind= and advertise= for the server listen address, 
and if they are missing each is taken from the host= instead; and client 
connect addresses still use host=

If we do that though, if you just say "host=localhost" or omit the host 
(which currently means "host=localhost") then it will bind only to 
localhost, not INADDR_ANY. So we need a syntax other than omitting bind= 
to mean INADDR_ANY, perhaps bind=* or bind=any or something.


More information about the dbus mailing list