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:
6
nmap.cc
6
nmap.cc
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user