summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/channels.c b/channels.c
index 6808d3a05..233c2247b 100644
--- a/channels.c
+++ b/channels.c
@@ -3018,7 +3018,8 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
3018 error("setsockopt IPV6_V6ONLY: %.100s", strerror(errno)); 3018 error("setsockopt IPV6_V6ONLY: %.100s", strerror(errno));
3019 } 3019 }
3020#endif 3020#endif
3021 channel_set_reuseaddr(sock); 3021 if (x11_use_localhost)
3022 channel_set_reuseaddr(sock);
3022 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { 3023 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
3023 debug2("bind port %d: %.100s", port, strerror(errno)); 3024 debug2("bind port %d: %.100s", port, strerror(errno));
3024 close(sock); 3025 close(sock);
@@ -3030,17 +3031,8 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
3030 break; 3031 break;
3031 } 3032 }
3032 socks[num_socks++] = sock; 3033 socks[num_socks++] = sock;
3033#ifndef DONT_TRY_OTHER_AF
3034 if (num_socks == NUM_SOCKS) 3034 if (num_socks == NUM_SOCKS)
3035 break; 3035 break;
3036#else
3037 if (x11_use_localhost) {
3038 if (num_socks == NUM_SOCKS)
3039 break;
3040 } else {
3041 break;
3042 }
3043#endif
3044 } 3036 }
3045 freeaddrinfo(aitop); 3037 freeaddrinfo(aitop);
3046 if (num_socks > 0) 3038 if (num_socks > 0)