You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2014/01/23 17:26:57 UTC

git commit: [SSHD-270] When remote port != 0 for tcpip-forward the server will not reply w/ a port

Updated Branches:
  refs/heads/master 154b3cffb -> 0095939bd


[SSHD-270] When remote port != 0 for tcpip-forward the server will not reply w/ a port

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0095939b
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0095939b
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0095939b

Branch: refs/heads/master
Commit: 0095939bd864b93a701678ecd55218b5fc3dd935
Parents: 154b3cf
Author: Guillaume Nodet <gn...@apache.org>
Authored: Thu Jan 23 17:26:49 2014 +0100
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Thu Jan 23 17:26:49 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0095939b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
index fc63d20..640e1a2 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
@@ -100,7 +100,7 @@ public class DefaultTcpipForwarder implements TcpipForwarder, IoHandler {
         if (result == null) {
             throw new SshException("Tcpip forwarding request denied by server");
         }
-        int port = result.getInt();
+        int port = remote.getPort() == 0 ? result.getInt() : remote.getPort();
         // TODO: Is it really safe to only store the local address after the request ?
         remoteToLocal.put(port, local);
         return new SshdSocketAddress(remote.getHostName(), port);