mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Use the right errno in handle_connect_result catch-all assert.
We call getsockopt(SO_ERROR) to get the socket error, but then we were calling perror, which uses the global errno instead.
This commit is contained in:
parent
47ee706a4a
commit
df3b01e5d8
1 changed files with 2 additions and 4 deletions
|
|
@ -312,7 +312,6 @@ static int iod_add_event(msiod *iod, msevent *nse) {
|
|||
void handle_connect_result(mspool *ms, msevent *nse, enum nse_status status) {
|
||||
int optval;
|
||||
socklen_t optlen = sizeof(int);
|
||||
char buf[1024];
|
||||
msiod *iod = nse->iod;
|
||||
#if HAVE_OPENSSL
|
||||
int sslerr;
|
||||
|
|
@ -360,9 +359,8 @@ void handle_connect_result(mspool *ms, msevent *nse, enum nse_status status) {
|
|||
nse->errnum = optval;
|
||||
break;
|
||||
default:
|
||||
Snprintf(buf, sizeof(buf), "Strange connect error from %s (%d)",
|
||||
inet_ntop_ez(&iod->peer, iod->peerlen), optval);
|
||||
perror(buf);
|
||||
fprintf(stderr, "Strange connect error from %s (%d): %s",
|
||||
inet_ntop_ez(&iod->peer, iod->peerlen), optval, socket_strerror(optval));
|
||||
assert(0); /* I'd like for someone to report it */
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue