diff --git a/source/commands2.c b/source/commands2.c index 344134b..3c01975 100644 --- a/source/commands2.c +++ b/source/commands2.c @@ -2576,7 +2576,7 @@ static int create_ipc_socket(void) init_socketpath(); - if ((s = connect_by_number(NULL, &port, SERVICE_SERVER, PROTOCOL_TCP, 0)) < 0) + if ((s = connect_by_number("127.0.0.1", &port, SERVICE_SERVER, PROTOCOL_TCP, 0)) < 0) { bitchsay("Error creating IPC socket: [%d] %s", s, strerror(errno)); return 1; diff --git a/source/network.c b/source/network.c index dd318a8..cad3093 100644 --- a/source/network.c +++ b/source/network.c @@ -466,7 +466,11 @@ int BX_connect_by_number(char *hostn, unsigned short *portnum, int service, int memset(&name, 0, sizeof name); name.sin_family = AF_INET; - name.sin_addr.s_addr = htonl(INADDR_ANY); + + if (hostn) + inet_aton(hostn, &name.sin_addr); + else + name.sin_addr.s_addr = htonl(INADDR_ANY); name.sin_port = htons(*portnum); #ifdef PARANOID