Port forwardings are duplicated when connecting to host by nickname

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hello,

I found a problem with port forwardings specified in the
config file.

The following is run on OpenSSH 6.7p1:


Assume the following ~/.ssh/config:

Host some.host.name.com foo
    Hostname some.host.name.com
    DynamicForward 55555


When connecting to the real hostname everything is fine:

$ ssh -v some.host.name.com
...
debug1: Local connections to LOCALHOST:55555 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 55555.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 55555.
debug1: channel 1: new [port listener]
...


But when using the short nickname:

$ ssh -v foo
...
debug1: Hostname has changed; re-reading configuration
...
debug1: Local connections to LOCALHOST:55555 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 55555.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 55555.
debug1: channel 1: new [port listener]
debug1: Local connections to LOCALHOST:55555 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 55555.
bind: Address already in use
debug1: Local forwarding listening on 127.0.0.1 port 55555.
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 55555
...


The reason is that in the second case OpenSSH reparses the config
and then tries to adds the same forwarding rules again.


I looked into the source and there is a method compare_forward()
in mux.c that is used to prevent adding of duplicates.
Maybe that should be used also when parsing the config or
commandline in ssh.c / readconf.c?


Regards,
Sebastian
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux