diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-10-25 00:15:35 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-10-25 12:26:06 +1100 |
commit | acf559e1cffbd1d6167cc1742729fc381069f06b (patch) | |
tree | fc127e0bce21056c96dec59ebdc9e2ff9f5b1e4a /channels.c | |
parent | b9903ee8ee8671b447fc260c2bee3761e26c7227 (diff) |
upstream commit
Add optional rdomain qualifier to sshd_config's
ListenAddress option to allow listening on a different rdomain(4), e.g.
ListenAddress 0.0.0.0 rdomain 4
Upstream-ID: 24b6622c376feeed9e9be8b9605e593695ac9091
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/channels.c b/channels.c index 83442be06..07dc9577a 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.375 2017/09/24 13:45:34 djm Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.376 2017/10/25 00:15:35 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 |
@@ -1668,19 +1668,6 @@ port_open_helper(struct ssh *ssh, Channel *c, char *rtype) | |||
1668 | free(local_ipaddr); | 1668 | free(local_ipaddr); |
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | static void | ||
1672 | channel_set_reuseaddr(int fd) | ||
1673 | { | ||
1674 | int on = 1; | ||
1675 | |||
1676 | /* | ||
1677 | * Set socket options. | ||
1678 | * Allow local port reuse in TIME_WAIT. | ||
1679 | */ | ||
1680 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) | ||
1681 | error("setsockopt SO_REUSEADDR fd %d: %s", fd, strerror(errno)); | ||
1682 | } | ||
1683 | |||
1684 | void | 1671 | void |
1685 | channel_set_x11_refuse_time(struct ssh *ssh, u_int refuse_time) | 1672 | channel_set_x11_refuse_time(struct ssh *ssh, u_int refuse_time) |
1686 | { | 1673 | { |
@@ -3368,7 +3355,7 @@ channel_setup_fwd_listener_tcpip(struct ssh *ssh, int type, | |||
3368 | continue; | 3355 | continue; |
3369 | } | 3356 | } |
3370 | 3357 | ||
3371 | channel_set_reuseaddr(sock); | 3358 | set_reuseaddr(sock); |
3372 | if (ai->ai_family == AF_INET6) | 3359 | if (ai->ai_family == AF_INET6) |
3373 | sock_set_v6only(sock); | 3360 | sock_set_v6only(sock); |
3374 | 3361 | ||
@@ -4439,7 +4426,7 @@ x11_create_display_inet(struct ssh *ssh, int x11_display_offset, | |||
4439 | if (ai->ai_family == AF_INET6) | 4426 | if (ai->ai_family == AF_INET6) |
4440 | sock_set_v6only(sock); | 4427 | sock_set_v6only(sock); |
4441 | if (x11_use_localhost) | 4428 | if (x11_use_localhost) |
4442 | channel_set_reuseaddr(sock); | 4429 | set_reuseaddr(sock); |
4443 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { | 4430 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
4444 | debug2("%s: bind port %d: %.100s", __func__, | 4431 | debug2("%s: bind port %d: %.100s", __func__, |
4445 | port, strerror(errno)); | 4432 | port, strerror(errno)); |