1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-04-24 10:09:49 +02:00

Fix small issue with return results

This commit is contained in:
OJ 2013-11-25 16:28:47 +10:00
parent c947f9d1f6
commit 9f4a66ba8a

@ -305,9 +305,11 @@ DWORD request_net_tcp_server_channel_open(Remote * remote, Packet * packet)
if (bind(ctx->fd, (SOCKADDR *)&saddr, sizeof(SOCKADDR_IN)) == SOCKET_ERROR) if (bind(ctx->fd, (SOCKADDR *)&saddr, sizeof(SOCKADDR_IN)) == SOCKET_ERROR)
{ {
#ifdef _WIN32 #ifdef _WIN32
if (WSAGetLastError() != WSAEADDRNOTAVAIL) dwResult = WSAGetLastError();
if (dwResult != WSAEADDRNOTAVAIL)
#else #else
if (errno != EADDRNOTAVAIL) dwResult = errno;
if (dwResult != EADDRNOTAVAIL)
#endif #endif
{ {
BREAK_ON_WSAERROR("[TCP-SERVER] request_net_tcp_server_channel_open. bind failed"); BREAK_ON_WSAERROR("[TCP-SERVER] request_net_tcp_server_channel_open. bind failed");
@ -322,6 +324,7 @@ DWORD request_net_tcp_server_channel_open(Remote * remote, Packet * packet)
{ {
BREAK_ON_WSAERROR("[TCP-SERVER] request_net_tcp_server_channel_open. bind failed"); BREAK_ON_WSAERROR("[TCP-SERVER] request_net_tcp_server_channel_open. bind failed");
} }
dwResult = ERROR_SUCCESS;
} }
if (listen(ctx->fd, SOMAXCONN) == SOCKET_ERROR) if (listen(ctx->fd, SOMAXCONN) == SOCKET_ERROR)