mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
change sizeof(struct sockaddr_storage) to real sockaddr len
This commit is contained in:
@@ -287,8 +287,7 @@ int send_rpc_query(Target *target_host, unsigned short portno,
|
|||||||
if ((tcp_rpc_socket = socket(sock.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
if ((tcp_rpc_socket = socket(sock.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
||||||
pfatal("Socket troubles in %s", __func__);
|
pfatal("Socket troubles in %s", __func__);
|
||||||
/* I should unblock the socket here and timeout the connect() */
|
/* I should unblock the socket here and timeout the connect() */
|
||||||
res = connect(tcp_rpc_socket, (struct sockaddr *) &sock,
|
res = connect(tcp_rpc_socket, (struct sockaddr *) &sock, socklen);
|
||||||
sizeof(struct sockaddr_storage));
|
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
if (o.debugging) {
|
if (o.debugging) {
|
||||||
gh_perror("Failed to connect to port %d of %s in %s",
|
gh_perror("Failed to connect to port %d of %s in %s",
|
||||||
@@ -329,7 +328,7 @@ int send_rpc_query(Target *target_host, unsigned short portno,
|
|||||||
if (o.debugging > 1)
|
if (o.debugging > 1)
|
||||||
hdump((unsigned char *) rpch, sizeof(struct rpc_hdr));
|
hdump((unsigned char *) rpch, sizeof(struct rpc_hdr));
|
||||||
res = sendto(udp_rpc_socket, (char *)rpch, sizeof(struct rpc_hdr), 0,
|
res = sendto(udp_rpc_socket, (char *)rpch, sizeof(struct rpc_hdr), 0,
|
||||||
(struct sockaddr *) &sock, sizeof(struct sockaddr_storage));
|
(struct sockaddr *) &sock, socklen);
|
||||||
if (res == -1)
|
if (res == -1)
|
||||||
err = socket_errno();
|
err = socket_errno();
|
||||||
} while(res == -1 && (err == EINTR || err == ENOBUFS));
|
} while(res == -1 && (err == EINTR || err == ENOBUFS));
|
||||||
|
|||||||
Reference in New Issue
Block a user