Commit 5198dabc authored by Lennart Poettering's avatar Lennart Poettering

man: document behaviour of ListenStream= with only a port number in regards to IPv4/IPv6

parent 0b507b17
...@@ -170,8 +170,13 @@ ...@@ -170,8 +170,13 @@
<para>If the address string is a <para>If the address string is a
single number it is read as port single number it is read as port
number to listen on for both IPv4 and number to listen on via
IPv6.</para> IPv6. Depending on the value of
<varname>BindIPv6Only=</varname> (see below) this
might result in the service being
available via both IPv6 and IPv4 (default) or
just via IPv6.
</para>
<para>If the address string is a <para>If the address string is a
string in the format v.w.x.y:z it is string in the format v.w.x.y:z it is
...@@ -181,7 +186,12 @@ ...@@ -181,7 +186,12 @@
<para>If the address string is a <para>If the address string is a
string in the format [x]:y it is read string in the format [x]:y it is read
as IPv6 address x on a port y.</para> as IPv6 address x on a port y. Note
that this might make the service
available via IPv4, too, depending on
the <varname>BindIPv6Only=</varname>
setting (see below).
</para>
<para>Note that SOCK_SEQPACKET <para>Note that SOCK_SEQPACKET
(i.e. <varname>ListenSequentialPacket=</varname>) (i.e. <varname>ListenSequentialPacket=</varname>)
...@@ -286,7 +296,10 @@ ...@@ -286,7 +296,10 @@
default, surprise!) the system wide default, surprise!) the system wide
default setting is used, as controlled default setting is used, as controlled
by by
<filename>/proc/sys/net/ipv6/bindv6only</filename>.</para> <filename>/proc/sys/net/ipv6/bindv6only</filename>,
which in turn defaults to the
equivalent of
<option>both</option>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -326,10 +326,12 @@ int config_parse_socket_bind( ...@@ -326,10 +326,12 @@ int config_parse_socket_bind(
s = SOCKET(data); s = SOCKET(data);
if ((b = socket_address_bind_ipv6_only_from_string(rvalue)) < 0) { b = socket_address_bind_ipv6_only_from_string(rvalue);
if (b < 0) {
int r; int r;
if ((r = parse_boolean(rvalue)) < 0) { r = parse_boolean(rvalue);
if (r < 0) {
log_error("[%s:%u] Failed to parse bind IPv6 only value, ignoring: %s", filename, line, rvalue); log_error("[%s:%u] Failed to parse bind IPv6 only value, ignoring: %s", filename, line, rvalue);
return 0; return 0;
} }
......
...@@ -167,7 +167,8 @@ int socket_address_parse(SocketAddress *a, const char *s) { ...@@ -167,7 +167,8 @@ int socket_address_parse(SocketAddress *a, const char *s) {
} else { } else {
/* Just a port */ /* Just a port */
if ((r = safe_atou(s, &u)) < 0) r = safe_atou(s, &u);
if (r < 0)
return r; return r;
if (u <= 0 || u > 0xFFFF) if (u <= 0 || u > 0xFFFF)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment