Bug 3285

Summary: Wrong documentation on -D The bind_address
Product: Portable OpenSSH Reporter: dewi jones <dewijones92>
Component: DocumentationAssignee: Assigned to nobody <unassigned-bugs>
Status: NEW ---    
Severity: trivial CC: dewijones92, djm
Priority: P5    
Version: 8.5p1   
Hardware: All   
OS: Linux   

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