diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-10-10 10:27:21 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-10-10 10:27:21 +1100 |
commit | 71152bc9911bc34a98810b2398dac20df3fe8de3 (patch) | |
tree | f4267d4f757eb26429e15857ebb8c9b7de62713f /channels.c | |
parent | b59aaf3c4f3f449a4b86d8528668bd979be9aa5f (diff) |
- djm@cvs.openbsd.org 2013/09/19 01:24:46
[channels.c]
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 'channels.c')
-rw-r--r-- | channels.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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 @@ -2710,8 +2710,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; } |