Bug 1000 - LocalForward,RemoteForward directives wrong in ssh_config.5
Summary: LocalForward,RemoteForward directives wrong in ssh_config.5
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 4.0p1
Hardware: All All
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: openbsd, patch
Depends on:
Blocks: 994
  Show dependency treegraph
 
Reported: 2005-03-15 22:31 AEDT by Ponraj
Modified: 2006-10-07 11:39 AEST (History)
1 user (show)

See Also:


Attachments
Patch for LocalForward,RemoteForward directives with bind_address option (684 bytes, patch)
2005-03-15 22:34 AEDT, Ponraj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ponraj 2005-03-15 22:31:48 AEDT
It seams there is a problem in "LocalForward,RemoteForward directives with 
bind_address". 

ssh expects the argument and source details as follows.
-o "LocalForward      port      [bind_address:]host:hostport ".

But in the coding bindaddress and port are interchanged in the assignment the 
file readconf.c
 
1111                  fwd->listen_host = xstrdup(cleanhostname(fwdarg[0]));
1112                  fwd->listen_port = a2port(fwdarg[1]);

Sample run : 
ssh -N -vvv -o "LocalForward 2000 172.16.1.182:172.16.1.165:22" localhost

 
Where 
fwdarg[0]= 2000
fwdarg[1]= 172.16.1.182
fwdarg[2]= 172.16.1.165
fwdarg[3]= 22.
Comment 1 Ponraj 2005-03-15 22:34:56 AEDT
Created attachment 855 [details]
Patch for LocalForward,RemoteForward directives with bind_address option

Attched patch fixes above problem.
Comment 2 Darren Tucker 2005-03-15 22:42:06 AEDT
(In reply to comment #0)
> Sample run : 
> ssh -N -vvv -o "LocalForward 2000 172.16.1.182:172.16.1.165:22" localhost

The bind address is optional before the port, same as -L/-R.  That should be:

LocalForward 172.16.1.182:2000 172.16.1.165:22

I see that ssh_config(5) says that the first argument must be a port, though, so
it ought to be fixed.
Comment 3 Markus Friedl 2005-03-15 22:44:58 AEDT
yes, the manpage is wrong.
Comment 4 Darren Tucker 2005-03-16 22:52:35 AEDT
The documentation has been updated in OpenBSD and will be appear in Portable
shortly.  The relevant part of the description of LocalForward now reads:

The first argument must be [bind_address:]port
and the second argument must be host:hostport.  IPv6 addresses
can be specified by enclosing addresses in square brackets or by
using an alternative syntax: [bind_address/]port and
host/hostport.

Thanks for the report.
Comment 5 Darren Tucker 2006-10-07 11:39:18 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.