mirror of
https://github.com/nmap/nmap.git
synced 2026-10-24 21:02:11 +00:00
Allow nsock_iod_get_communication_info() to get latest UDP peer
This commit is contained in:
parent
ba4a108868
commit
dde9c509ed
1 changed files with 5 additions and 1 deletions
|
|
@ -638,11 +638,15 @@ static int do_actual_read(struct npool *ms, struct nevent *nse) {
|
|||
err = socket_errno();
|
||||
}
|
||||
else {
|
||||
if (peerlen > 0
|
||||
#ifdef WIN32
|
||||
/* Windows will ignore src_addr and addrlen arguments to recvfrom on TCP
|
||||
* sockets, so peerlen is still sizeof(peer) and peer is junk. Instead,
|
||||
* only set this if it's not already set.
|
||||
*/
|
||||
if (peerlen > 0 && iod->peerlen == 0) {
|
||||
&& (iod->lastproto == IPPROTO_UDP || iod->peerlen == 0)
|
||||
#endif
|
||||
) {
|
||||
assert(peerlen <= sizeof(iod->peer));
|
||||
memcpy(&iod->peer, &peer, peerlen);
|
||||
iod->peerlen = peerlen;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue