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.
This commit is contained in:
Kevin Easton
2017-02-16 22:06:32 +11:00
parent 1f062fb7de
commit 790cb771ed
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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;