| Summary: | docs: don't suggest "*" as a hostname unless it is portable | ||
|---|---|---|---|
| Product: | dbus | Reporter: | Chengwei Yang <chengwei.yang.cn> |
| Component: | core | Assignee: | Simon McVittie <smcv> |
| Status: | RESOLVED FIXED | QA Contact: | D-Bus Maintainers <dbus> |
| Severity: | enhancement | ||
| Priority: | low | CC: | alban.crequy, chengwei.yang.cn, msniko14, thiago, walters |
| Version: | 1.5 | Keywords: | patch |
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | review? | ||
| i915 platform: | i915 features: | ||
| Attachments: | Do not claim that '*' resolves to INADDR_ANY on all OSs | ||
|
Description
Chengwei Yang
2013-12-04 07:45:15 UTC
The FreeBSD 9.1 man page getaddrinfo(3) says something about hostname below.
The hostname and servname arguments are either pointers to NUL-terminated
strings or the null pointer. An acceptable value for hostname is either
a valid host name or a numeric host address string consisting of a dotted
decimal IPv4 address or an IPv6 address.
So "*" isn't an acceptable value for hostname.
Just tried to find how the users learn that "*" is a valid value for host, in tcp/nonce-tcp transport. However, I didn't find that in both DBus Spec or dbus-daemon(1), so I'm curious, the only said in dbus-daemon is that
The bind option can also take a special name '*' to cause the bus to listen
on all local address (INADDR_ANY)
Which OS(s) do consider "*" to be a valid hostname? As far as I'm concerned, the preferred syntax to express "listen on every IPv4 address" is 0.0.0.0 (which I believe is portable); omitting the "host" part entirely might also work. If "host=*,port=3000" happens to work on Windows, or on platforms with GNU libc, or some other subset of platforms (because their libc resolver resolves * to 0.0.0.0), we shouldn't forbid that; but I also think we shouldn't recommend it, or go out of our way to make it more portable. Analogously: localhost resolving to 127.0.0.1 is common, but not universal, and we should use host=127.0.0.1 in our defaults and documentation. The only mention of '*' that I can find is this, in dbus-daemon(1):
<para>tcp/nonce-tcp addresses also allow a bind=hostname option,
[...]
or '*'
to listen on all interfaces simultaneously.
<para>Example: <listen>tcp:host=localhost,bind=*,port=0</listen></para>
Created attachment 106134 [details] [review] Do not claim that '*' resolves to INADDR_ANY on all OSs This documentation fix is a month old and has not had any comments, so I assume nobody has any objection to it. Fixed in git for 1.9.2. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.