default tcp host
Daniel P. Berrange
dan at berrange.com
Thu Jun 14 12:03:01 PDT 2007
On Thu, Jun 14, 2007 at 05:15:07PM -0400, Ray Strode wrote:
> >We could explicitly call gethostname() to retrieve the local hosts'
> >primary name & put that into the address in the INADDR_ANY scenario
> >which is basically what X does for DISPLAY env IIRC.
> That's a bad idea because gethostname() returns what the host calls
> itself, not necessarily what others call the host. The two match
> sometimes, but they are different things, and they don't always match.
> Also, think about the hostname, "localhost" ...
Forgot about that, so gethostname() is really not a viable option.
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
Havoc's current code which adds the all_interfaces=true flag to the
<listen> element and requires the admin to define the hostname
there as the value to be advertised. That would work in the simple
case, however, you may have multiple <listen> elements but only have
a single hostname that needs advertizing (if you're listening on
specific subset of IP addresses for a given hostname), or have only
one <listen> element but need to advertize multiple hostnames (if you
are listening on INADDR_ANY, but have multiple interfaces each with
different IP address / hostname).
Another option is to have a separate some separate XML element where you
detail what hostnames to advertise <advertise>foo.example.com</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
Bind to all addresses, don't advertize any hostname
Bind to foo.example.com & advertize that
Bind to foo.example.com & don't advertize any hostname
Bind to 123.453.25.255 & advertize that
Bind to all addrresses, but advertize foo.example.com
Bind to bar.example.com, but advertize foo.example.com
(foo is a local nick name, but bar is the canonical name)
Bind to all addresses, advertize both bar & foo.example.com
Maybe there's other options which work more effectively based on the
way Avahi stuff is to interact with DBus daemon ?
|=- 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
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070614/19036f88/attachment.pgp
More information about the dbus