diff --git a/src/network/net_modem.c b/src/network/net_modem.c index fe8ebfc57..c7d0aea2c 100644 --- a/src/network/net_modem.c +++ b/src/network/net_modem.c @@ -153,6 +153,7 @@ static modem_t *instance; #define MREG_DTR_DELAY 25 static void modem_do_command(modem_t* modem); +static void modem_accept_incoming_call(modem_t* modem); extern ssize_t local_getline(char **buf, size_t *bufsiz, FILE *fp); @@ -558,7 +559,6 @@ modem_reset(modem_t* modem) void modem_dial(modem_t* modem, const char* str) { - /* TODO: Port TCP/IP support from DOSBox. */ modem->tcpIpConnCounter = 0; modem->tcpIpMode = false; if (!strncmp(str, "0.0.0.0", sizeof("0.0.0.0") - 1)) @@ -822,8 +822,12 @@ modem_do_command(modem_t* modem) break; case 'A': // Answer call { - modem_send_res(modem, ResERROR); - return; + if (modem->waitingclientsocket == -1) { + modem_send_res(modem, ResERROR); + return; + } + modem_accept_incoming_call(modem); + break; } return; case 'Z': { // Reset and load profiles diff --git a/src/unix/unix_netsocket.c b/src/unix/unix_netsocket.c index 9e9ac2f49..e6ec6285f 100644 --- a/src/unix/unix_netsocket.c +++ b/src/unix/unix_netsocket.c @@ -144,7 +144,7 @@ int plat_netsocket_connect(SOCKET socket, const char* hostname, unsigned short p sock_addr.sin_addr.s_addr = inet_addr(hostname); sock_addr.sin_port = htons(port); - if (sock_addr.sin_addr.s_addr == INADDR_ANY || sock_addr.sin_addr.s_addr == 0) { + if (sock_addr.sin_addr.s_addr == ((in_addr_t)-1) || sock_addr.sin_addr.s_addr == 0) { struct hostent *hp; hp = gethostbyname(hostname);