summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/channels.c b/channels.c
index 26b63a1aa..6be121970 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.266 2006/08/29 10:40:18 djm Exp $ */ 1/* $OpenBSD: channels.c,v 1.267 2006/12/12 03:58:42 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2525,11 +2525,18 @@ channel_request_remote_forwarding(const char *listen_host, u_short listen_port,
2525 /* Send the forward request to the remote side. */ 2525 /* Send the forward request to the remote side. */
2526 if (compat20) { 2526 if (compat20) {
2527 const char *address_to_bind; 2527 const char *address_to_bind;
2528 if (listen_host == NULL) 2528 if (listen_host == NULL) {
2529 address_to_bind = "localhost"; 2529 if (datafellows & SSH_BUG_RFWD_ADDR)
2530 else if (*listen_host == '\0' || strcmp(listen_host, "*") == 0) 2530 address_to_bind = "127.0.0.1";
2531 address_to_bind = ""; 2531 else
2532 else 2532 address_to_bind = "localhost";
2533 } else if (*listen_host == '\0' ||
2534 strcmp(listen_host, "*") == 0) {
2535 if (datafellows & SSH_BUG_RFWD_ADDR)
2536 address_to_bind = "0.0.0.0";
2537 else
2538 address_to_bind = "";
2539 } else
2533 address_to_bind = listen_host; 2540 address_to_bind = listen_host;
2534 2541
2535 packet_start(SSH2_MSG_GLOBAL_REQUEST); 2542 packet_start(SSH2_MSG_GLOBAL_REQUEST);