1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Store port numbers in host byte order in number-to-service mapping.

I don't know why these were in network byte order. Every single
interaction had a htons on entrance and ntohs on exit.
This commit is contained in:
david
2012-09-25 05:24:16 +00:00
parent b084226813
commit a0601febeb
4 changed files with 23 additions and 26 deletions

View File

@@ -2661,15 +2661,15 @@ static void getpts_aux(const char *origexpr, int nested, u8 *porttbl, int range_
} else {
if (nested) {
if ((range_type & SCAN_TCP_PORT) &&
nmap_getservbyport(htons(rangestart), "tcp")) {
nmap_getservbyport(rangestart, "tcp")) {
porttbl[rangestart] |= SCAN_TCP_PORT;
}
if ((range_type & SCAN_UDP_PORT) &&
nmap_getservbyport(htons(rangestart), "udp")) {
nmap_getservbyport(rangestart, "udp")) {
porttbl[rangestart] |= SCAN_UDP_PORT;
}
if ((range_type & SCAN_SCTP_PORT) &&
nmap_getservbyport(htons(rangestart), "sctp")) {
nmap_getservbyport(rangestart, "sctp")) {
porttbl[rangestart] |= SCAN_SCTP_PORT;
}
if ((range_type & SCAN_PROTOCOLS) &&