diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | channels.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -4,6 +4,10 @@ [cipher.c mac.c] remove some logging that makes ssh debugging output very verbose; ok markus + - djm@cvs.openbsd.org 2014/02/15 23:05:36 + [channels.c] + avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W; + bz#2200, debian#738692 via Colin Watson; ok dtucker@ 20140221 - (tim) [configure.ac] Fix cut-and-paste error. Patch from Bryan Drewery. @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.329 2014/01/31 16:39:19 tedu Exp $ */ +/* $OpenBSD: channels.c,v 1.330 2014/02/15 23:05:36 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1386,7 +1386,7 @@ port_open_helper(Channel *c, char *rtype) int direct; char buf[1024]; char *local_ipaddr = get_local_ipaddr(c->sock); - int local_port = get_sock_port(c->sock, 1); + int local_port = c->sock == -1 ? 65536 : get_sock_port(c->sock, 1); char *remote_ipaddr = get_peer_ipaddr(c->sock); int remote_port = get_peer_port(c->sock); |