diff options
Diffstat (limited to 'debian/patches/getsockname-error.patch')
-rw-r--r-- | debian/patches/getsockname-error.patch | 27 |
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 @@ | |||
1 | From 18e1479bf4586a14b88dab082af10a8981b9d48d Mon Sep 17 00:00:00 2001 | ||
2 | From: Damien Miller <djm@mindrot.org> | ||
3 | Date: Sat, 15 Feb 2014 02:08:20 +0000 | ||
4 | Subject: Skip get_sock_port call for c->sock==-1 | ||
5 | |||
6 | Origin: upstream, https://bugzilla.mindrot.org/show_bug.cgi?id=2200 | ||
7 | Bug-Debian: http://bugs.debian.org/738693 | ||
8 | Last-Update: 2014-02-15 | ||
9 | |||
10 | Patch-Name: getsockname-error.patch | ||
11 | --- | ||
12 | channels.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/channels.c b/channels.c | ||
16 | index 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 | |||