Skip to content

Commit

Permalink
upstream: the GatewayPorts vs -R listen address selection logic is
Browse files Browse the repository at this point in the history
still confusing people, so add another comment explaining the special
handling of "localhost"; bz#3258

OpenBSD-Commit-ID: e6bf0f0fbf1c7092bf0dbd9c6eab105970b5b53a
  • Loading branch information
djmdjm committed Jan 25, 2020
1 parent 734f2f8 commit 846446b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions channels.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.c,v 1.394 2019/07/07 01:05:00 dtucker Exp $ */
/* $OpenBSD: channels.c,v 1.395 2020/01/25 06:40:20 djm Exp $ */
/*
* Author: Tatu Ylonen <[email protected]>
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
Expand Down Expand Up @@ -3356,7 +3356,12 @@ channel_fwd_bind_addr(struct ssh *ssh, const char *listen_addr, int *wildcardp,
} 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 */
/*
* Accept explicit localhost address when
* GatewayPorts=yes. The "localhost" hostname is
* deliberately skipped here so it will listen on all
* available local address families.
*/
addr = listen_addr;
}
} else if (strcmp(listen_addr, "127.0.0.1") == 0 ||
Expand Down

0 comments on commit 846446b

Please sign in to comment.