mirror of
https://github.com/nmap/nmap.git
synced 2026-06-30 05:05:53 +00:00
Set target port number based on target af, not o.af.
o.af is AF_UNSPEC at this point in the common case that neither -4 nor -6 was given. The code was falling through to the "else" IPv6 case. I think we were getting luck with this because the port number happens to be in the same place in sockaddr_in and sockaddr_in6.
This commit is contained in:
parent
665e6b9e70
commit
0d3a8846b0
1 changed files with 1 additions and 1 deletions
|
|
@ -639,7 +639,7 @@ int main(int argc, char *argv[])
|
|||
o.portno = (unsigned short) long_port;
|
||||
}
|
||||
|
||||
if (o.af == AF_INET)
|
||||
if (targetss.storage.ss_family == AF_INET)
|
||||
targetss.in.sin_port = htons(o.portno);
|
||||
#ifdef HAVE_IPV6
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue