summaryrefslogtreecommitdiff
path: root/debian/patches/getsockname-error.patch
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-15 02:11:28 +0000
committerColin Watson <cjwatson@debian.org>2014-02-15 02:11:39 +0000
commit2fe6a8711420abb2751e1b36e880019e8fb134a1 (patch)
treeef6297a2a353f609318f0d4131e9b22119b73f4e /debian/patches/getsockname-error.patch
parent99a7116957f4fe28a42db97edb20c424b4aa593d (diff)
parent18e1479bf4586a14b88dab082af10a8981b9d48d (diff)
Fix getsockname errors when using "ssh -W" (closes: #738693).
Diffstat (limited to 'debian/patches/getsockname-error.patch')
-rw-r--r--debian/patches/getsockname-error.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/getsockname-error.patch b/debian/patches/getsockname-error.patch
new file mode 100644
index 000000000..b4dbc2c9f
--- /dev/null
+++ b/debian/patches/getsockname-error.patch
@@ -0,0 +1,27 @@
1From 18e1479bf4586a14b88dab082af10a8981b9d48d Mon Sep 17 00:00:00 2001
2From: Damien Miller <djm@mindrot.org>
3Date: Sat, 15 Feb 2014 02:08:20 +0000
4Subject: Skip get_sock_port call for c->sock==-1
5
6Origin: upstream, https://bugzilla.mindrot.org/show_bug.cgi?id=2200
7Bug-Debian: http://bugs.debian.org/738693
8Last-Update: 2014-02-15
9
10Patch-Name: getsockname-error.patch
11---
12 channels.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/channels.c b/channels.c
16index e741f29..8e66265 100644
17--- a/channels.c
18+++ b/channels.c
19@@ -1386,7 +1386,7 @@ port_open_helper(Channel *c, char *rtype)
20 int direct;
21 char buf[1024];
22 char *local_ipaddr = get_local_ipaddr(c->sock);
23- int local_port = get_sock_port(c->sock, 1);
24+ int local_port = c->sock == -1 ? 65536 : get_sock_port(c->sock, 1);
25 char *remote_ipaddr = get_peer_ipaddr(c->sock);
26 int remote_port = get_peer_port(c->sock);
27