From 7ad21ca66f5a46be231fffe884ac2c3b5d97c7ae Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Tue, 4 Apr 2017 19:53:05 +0200 Subject: 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. --- lib/ssh/doc/src/ssh.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'lib/ssh/doc') 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. Port = integer() - HostAddress = ip_address() | any + HostAddress = ip_address() | any | loopback Options = [{Option, Value}] Option = atom() Value = term() @@ -390,6 +390,26 @@

Starts a server listening for SSH connections on the given port. If the Port is 0, a random free port is selected. See daemon_info/1 about how to find the selected port number.

+ +

Please note that by historical reasons both the HostAddress argument and the inet socket option + ip set the listening address. This is a source of possible inconsistent settings.

+ +

The rules for handling the two address passing options are:

+ + if HostAddress is an ip-address, that ip-address is the listening address. + An ip-option will be discarded if present. + + if HostAddress is loopback, the listening address + is loopback and an loopback address will be choosen by the underlying layers. + An ip-option will be discarded if present. + + if HostAddress is any and no ip-option is present, the listening address is + any and the socket will listen to all addresses + + if HostAddress is any and an ip-option is present, the listening address is + set to the value of the ip-option + +

Options:

-- cgit v1.2.3