summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-01-30 21:12:09 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-01-30 21:12:09 +0000
commit8a6723cece76f3136441badb77f5fa4abe1c660b (patch)
tree2d0425660e241db81a2abf35a1aebd93d88b1b7c /usr.bin
parentbf4b49a2f77fb93288942f21b3d2268ea060349a (diff)
fake local addr:port when stdio fowarding as some servers (Tectia at
least) validate that they are well-formed; reported by imorgan AT nas.nasa.gov ok dtucker
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/channels.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 4174dc944ac..88a041caa95 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.302 2010/01/26 01:28:35 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.303 2010/01/30 21:12:08 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1371,6 +1371,13 @@ port_open_helper(Channel *c, char *rtype)
char *remote_ipaddr = get_peer_ipaddr(c->sock);
int remote_port = get_peer_port(c->sock);
+ if (remote_port == -1) {
+ /* Fake addr/port to appease peers that validate it (Tectia) */
+ xfree(remote_ipaddr);
+ remote_ipaddr = xstrdup("127.0.0.1");
+ remote_port = 65535;
+ }
+
direct = (strcmp(rtype, "direct-tcpip") == 0);
snprintf(buf, sizeof buf,