Bug 3285 - Wrong documentation on -D The bind_address
Summary: Wrong documentation on -D The bind_address
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 8.5p1
Hardware: All Linux
: P5 trivial
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-21 19:45 AEDT by dewi jones
Modified: 2021-03-23 19:12 AEDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dewi jones 2021-03-21 19:45:19 AEDT
The man page says this:
The bind_address of “localhost” indicates that the listening port be bound for local use only, while an empty address or ‘*’ indicates that the port should be available from all interfaces.

However each of the following commands results in a different interface binding
./ssh -D 1337 -vvvv -C -N  dewi@192.168.1.1
tcp   LISTEN    0      128                                             127.0.0.1:1337                0.0.0.0:*      users:(("ssh",pid=75605,fd=5)) uid:1000 ino:336020 sk:474 <->  
                                               

./ssh -D *:1337 -vvvv -C -N  dewi@192.168.1.1
tcp   LISTEN    0      128                                               0.0.0.0:1337                0.0.0.0:*      users:(("ssh",pid=74357,fd=4)) uid:1000 ino:320497 sk:464 <-> 

So many the documentation should be different? or the code?
Many thanks
Comment 1 Damien Miller 2021-03-22 09:25:17 AEDT
You're missing this critical sentence, which comes immediately before:

> By default, the local port is bound in accordance with
> the GatewayPorts setting
Comment 2 dewi jones 2021-03-23 19:12:16 AEDT
ah nice catch.
But surely the following two statements contradict eachother? 

> The bind_address of “localhost” indicates that the listening port be > > bound for local use only, while an empty address or ‘*’ indicates that > the port should be available from all interfaces.

> By default, the local port is bound in accordance with the GatewayPorts setting.

An empty address' behaviour is governed by the second statement and is not necessarily "available from all interfaces"

Many thanks