Commit cdd5910
committed
SSHD-1269: Fix TCP/IP remote port forwarding with wildcard addresses
Remote port forwarding using an OpenSSH client and an Apache MINA sshd
server didn't work with wildcard addresses or with "localhost". For
instance,
ssh ... -R 0.0.0.0:0:somewhere:1234
would fail: the Apache MINA sshd server would send a forwarded-tcpip
request with 127.0.0.1:55555 (if port 55555 was chosen) to OpenSSH,
but OpenSSH expected 0.0.0.0:55555.
ssh ... -R 0:somewhere:1234
also failed in the same way.
Fix this by sending back in the forwarded-tcpip request the original
address with the bound port.
(Note: this was already fixed by SSHD-792 as of Apache MINA sshd 2.2.0,
but was broken again in 2.6.0. Unit tests using an Apache MINA sshd
client to initiate the remote port forwarding didn't detect the problem
because Apache MINA sshd only checks the port but not the hostname.)1 parent 9026fe6 commit cdd5910
File tree
5 files changed
+42
-10
lines changed- sshd-core/src
- main/java/org/apache/sshd/common/forward
- test/java/org/apache/sshd/common/forward
- sshd-mina
- sshd-netty
5 files changed
+42
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
71 | 81 | | |
| 82 | + | |
72 | 83 | | |
73 | | - | |
| 84 | + | |
74 | 85 | | |
75 | | - | |
| 86 | + | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| |||
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
92 | | - | |
93 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
94 | 118 | | |
95 | 119 | | |
96 | 120 | | |
| |||
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
116 | | - | |
| 140 | + | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
| |||
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
151 | | - | |
| 175 | + | |
| 176 | + | |
152 | 177 | | |
153 | 178 | | |
154 | 179 | | |
155 | 180 | | |
156 | 181 | | |
157 | | - | |
| 182 | + | |
158 | 183 | | |
159 | 184 | | |
160 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
0 commit comments