From 790cb771ed30a8330b915cbbbe2ea2025bd17839 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Thu, 16 Feb 2017 22:06:32 +1100 Subject: [PATCH] Use 127.0.0.1 for wserv socket, which fixes /WINDOW CREATE with IPv6 If wserv is told to connect to "localhost" it might try to connect to ::1, which won't work because the wserv socket is AF_INET only. So explicitly bind the socket and make the connection to "127.0.0.1" instead. --- Changelog | 2 ++ source/screen.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 735ffdc..bc930a9 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2.2] +* Use 127.0.0.1 for wserv socket, which fixes /WINDOW CREATE with IPv6. (caf) + * Allow INVITE and WALLOP floods to trigger auto-ignore. (caf) * Change $indextoword() so that the return value numbers the words from 0 diff --git a/source/screen.c b/source/screen.c index d032b9b..3eb3c33 100644 --- a/source/screen.c +++ b/source/screen.c @@ -1599,7 +1599,7 @@ extern Window *BX_create_additional_screen (void) screen_type == ST_SCREEN ? "screen" : "wound" ); port = 0; - s = connect_by_number(NULL, &port, SERVICE_SERVER, PROTOCOL_TCP, 0); + s = connect_by_number("127.0.0.1", &port, SERVICE_SERVER, PROTOCOL_TCP, 0); if (s < 0) { yell("Couldn't establish server side -- error [%d]", s); @@ -1676,7 +1676,7 @@ extern Window *BX_create_additional_screen (void) } *args_ptr++ = WSERV_PATH; - *args_ptr++ = "localhost"; + *args_ptr++ = "127.0.0.1"; *args_ptr++ = ltoa((long)port); *args_ptr++ = NULL;