mirror of
https://github.com/nmap/nmap.git
synced 2026-01-08 23:49:03 +00:00
Use socket_errno() instead of errno in NSE raw socket code, to get
Windows errors.
This commit is contained in:
@@ -2070,7 +2070,7 @@ static int l_dnet_open_ip(lua_State * L)
|
||||
|
||||
if (udata->sock == -1) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushfstring(L, "Failed to open raw socket: %s (errno %d)", socket_strerror(errno), errno);
|
||||
lua_pushfstring(L, "Failed to open raw socket: %s (errno %d)", socket_strerror(socket_errno()), socket_errno());
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -2198,7 +2198,7 @@ usesock:
|
||||
}
|
||||
if (ret == -1) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushfstring(L, "Error while sending: %s (errno %d)", socket_strerror(errno), errno);
|
||||
lua_pushfstring(L, "Error while sending: %s (errno %d)", socket_strerror(socket_errno()), socket_errno());
|
||||
return 2;
|
||||
}
|
||||
lua_pushboolean(L, true);
|
||||
|
||||
Reference in New Issue
Block a user