aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/doc
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-04-04 19:53:05 +0200
committerHans Nilsson <[email protected]>2017-04-07 10:23:41 +0200
commit7ad21ca66f5a46be231fffe884ac2c3b5d97c7ae (patch)
treee29e3010212809dc9c2981d36663a1e69aa9f680 /lib/ssh/doc
parent2f91341ae855b28c82024caa87c7541e94f68a18 (diff)
downloadotp-7ad21ca66f5a46be231fffe884ac2c3b5d97c7ae.tar.gz
otp-7ad21ca66f5a46be231fffe884ac2c3b5d97c7ae.tar.bz2
otp-7ad21ca66f5a46be231fffe884ac2c3b5d97c7ae.zip
ssh: document what happens when ssh:daemon sets both HostAddr and ip option
The idea is that the HostAddress argument takes precedence over an ip-option. However, an ip-option overrides the 'any' HostAddr. This fixes the case of dameon(Port, [{ip,IP}..] in a non-surprising way.
Diffstat (limited to 'lib/ssh/doc')
-rw-r--r--lib/ssh/doc/src/ssh.xml22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index 88d402cf38..48c9aa18e9 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -379,7 +379,7 @@
on the given port.</fsummary>
<type>
<v>Port = integer()</v>
- <v>HostAddress = ip_address() | any</v>
+ <v>HostAddress = ip_address() | any | loopback</v>
<v>Options = [{Option, Value}]</v>
<v>Option = atom()</v>
<v>Value = term()</v>
@@ -390,6 +390,26 @@
<p>Starts a server listening for SSH connections on the given
port. If the <c>Port</c> is 0, a random free port is selected. See
<seealso marker="#daemon_info/1">daemon_info/1</seealso> about how to find the selected port number.</p>
+
+ <p>Please note that by historical reasons both the <c>HostAddress</c> argument and the inet socket option
+ <c>ip</c> set the listening address. This is a source of possible inconsistent settings.</p>
+
+ <p>The rules for handling the two address passing options are:</p>
+ <list>
+ <item>if <c>HostAddress</c> is an ip-address, that ip-address is the listening address.
+ An ip-option will be discarded if present.</item>
+
+ <item>if <c>HostAddress</c> is <c>loopback</c>, the listening address
+ is <c>loopback</c> and an loopback address will be choosen by the underlying layers.
+ An ip-option will be discarded if present.</item>
+
+ <item>if <c>HostAddress</c> is <c>any</c> and no ip-option is present, the listening address is
+ <c>any</c> and the socket will listen to all addresses</item>
+
+ <item>if <c>HostAddress</c> is <c>any</c> and an ip-option is present, the listening address is
+ set to the value of the ip-option</item>
+ </list>
+
<p>Options:</p>
<taglist>
<tag><c><![CDATA[{inet, inet | inet6}]]></c></tag>