summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authordjm <djm>2014-05-21 07:12:53 +0000
committerdjm <djm>2014-05-21 07:12:53 +0000
commit330449de5bd3a2cfd9cb14516f8dbc8eb964d7d8 (patch)
treea9ec0f49a1d75e9fe3f127f6f517b83d91bcd489 /channels.c
parent3659a56607affbfd0741683a64318896e992d120 (diff)
downloadopenssh-330449de5bd3a2cfd9cb14516f8dbc8eb964d7d8.tar.gz
- (djm) [misc.c] Use CLOCK_BOOTTIME in preference to CLOCK_MONOTONIC
when it is available. It takes into account time spent suspended, thereby ensuring timeouts (e.g. for expiring agent keys) fire correctly. bz#2228 reported by John Haxby
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index 1020071f..ea79dd3c 100644
--- a/channels.c
+++ b/channels.c
@@ -2700,6 +2700,7 @@ channel_set_af(int af)
* "0.0.0.0" -> wildcard v4/v6 if SSH_OLD_FORWARD_ADDR
* "" (empty string), "*" -> wildcard v4/v6
* "localhost" -> loopback v4/v6
+ * "127.0.0.1" / "::1" -> accepted even if gateway_ports isn't set
*/
static const char *
channel_fwd_bind_addr(const char *listen_addr, int *wildcardp,
@@ -2729,9 +2730,20 @@ channel_fwd_bind_addr(const char *listen_addr, int *wildcardp,
"\"%s\" overridden by server "
"GatewayPorts", listen_addr);
}
- }
- else if (strcmp(listen_addr, "localhost") != 0)
+ } else if (strcmp(listen_addr, "localhost") != 0 ||
+ strcmp(listen_addr, "127.0.0.1") == 0 ||
+ strcmp(listen_addr, "::1") == 0) {
+ /* Accept localhost address when GatewayPorts=yes */
addr = listen_addr;
+ }
+ } else if (strcmp(listen_addr, "127.0.0.1") == 0 ||
+ strcmp(listen_addr, "::1") == 0) {
+ /*
+ * If a specific IPv4/IPv6 localhost address has been
+ * requested then accept it even if gateway_ports is in
+ * effect. This allows the client to prefer IPv4 or IPv6.
+ */
+ addr = listen_addr;
}
if (wildcardp != NULL)
*wildcardp = wildcard;