summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-25 06:40:20 +0000
committerDamien Miller <djm@mindrot.org>2020-01-25 18:20:01 +1100
commit846446bf3e7421e6671a4afd074bdf15eecd7832 (patch)
tree47e9691dd0087629dd344e36463923927e79ec66 /channels.c
parent734f2f83f5ff86f2967a99d67be9ce22dd0394dd (diff)
upstream: the GatewayPorts vs -R listen address selection logic is
still confusing people, so add another comment explaining the special handling of "localhost"; bz#3258 OpenBSD-Commit-ID: e6bf0f0fbf1c7092bf0dbd9c6eab105970b5b53a
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index 0f45aee4e..226ba7a39 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.394 2019/07/07 01:05:00 dtucker Exp $ */ 1/* $OpenBSD: channels.c,v 1.395 2020/01/25 06:40:20 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
@@ -3356,7 +3356,12 @@ channel_fwd_bind_addr(struct ssh *ssh, const char *listen_addr, int *wildcardp,
3356 } else if (strcmp(listen_addr, "localhost") != 0 || 3356 } else if (strcmp(listen_addr, "localhost") != 0 ||
3357 strcmp(listen_addr, "127.0.0.1") == 0 || 3357 strcmp(listen_addr, "127.0.0.1") == 0 ||
3358 strcmp(listen_addr, "::1") == 0) { 3358 strcmp(listen_addr, "::1") == 0) {
3359 /* Accept localhost address when GatewayPorts=yes */ 3359 /*
3360 * Accept explicit localhost address when
3361 * GatewayPorts=yes. The "localhost" hostname is
3362 * deliberately skipped here so it will listen on all
3363 * available local address families.
3364 */
3360 addr = listen_addr; 3365 addr = listen_addr;
3361 } 3366 }
3362 } else if (strcmp(listen_addr, "127.0.0.1") == 0 || 3367 } else if (strcmp(listen_addr, "127.0.0.1") == 0 ||