diff options
author | 2010-01-30 21:12:08 +0000 | |
---|---|---|
committer | 2010-01-30 21:12:08 +0000 | |
commit | ddbce02d5c14ff8bf9b2e4c0624b6595f5cd00b9 (patch) | |
tree | 3c4f32272a19f3d11970de7e75081222c1852e69 | |
parent | debug output goes to stderr, not "the system log"; ok markus dtucker (diff) | |
download | wireguard-openbsd-ddbce02d5c14ff8bf9b2e4c0624b6595f5cd00b9.tar.xz wireguard-openbsd-ddbce02d5c14ff8bf9b2e4c0624b6595f5cd00b9.zip |
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
-rw-r--r-- | usr.bin/ssh/channels.c | 9 |
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, |