summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2013-09-19 01:24:47 +0000
committerDamien Miller <djm@cvs.openbsd.org>2013-09-19 01:24:47 +0000
commit96f546a1ec75156e2927125e8919e5589bc4544a (patch)
tree5fbdc68a32f4afafc6fd5352aac25f24d33dd392 /usr.bin/ssh/channels.c
parentcee2ef4812fbf351ce6b2085f02188c792ec41e1 (diff)
bz#1297 - tell the client (via packet_send_debug) when their preferred
listen address has been overridden by the server's GatewayPorts; ok dtucker@
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r--usr.bin/ssh/channels.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index a8a98ea4b22..1c8a69bc907 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.325 2013/09/13 06:54:34 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.326 2013/09/19 01:24:46 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2685,8 +2685,20 @@ channel_fwd_bind_addr(const char *listen_addr, int *wildcardp,
if (((datafellows & SSH_OLD_FORWARD_ADDR) &&
strcmp(listen_addr, "0.0.0.0") == 0 && is_client == 0) ||
*listen_addr == '\0' || strcmp(listen_addr, "*") == 0 ||
- (!is_client && gateway_ports == 1))
+ (!is_client && gateway_ports == 1)) {
wildcard = 1;
+ /*
+ * Notify client if they requested a specific listen
+ * address and it was overridden.
+ */
+ if (*listen_addr != '\0' &&
+ strcmp(listen_addr, "0.0.0.0") != 0 &&
+ strcmp(listen_addr, "*") != 0) {
+ packet_send_debug("Forwarding listen address "
+ "\"%s\" overridden by server "
+ "GatewayPorts", listen_addr);
+ }
+ }
else if (strcmp(listen_addr, "localhost") != 0)
addr = listen_addr;
}