mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Key service table on protocol number, not name
This commit is contained in:
parent
6c6d4e33b5
commit
3a32543db0
4 changed files with 65 additions and 58 deletions
|
|
@ -149,7 +149,7 @@ void Port::getNmapServiceName(char *namebuf, int buflen) const {
|
|||
} else {
|
||||
const struct nservent *service;
|
||||
|
||||
service = nmap_getservbyport(portno, IPPROTO2STR(proto));
|
||||
service = nmap_getservbyport(portno, proto);
|
||||
if (service != NULL)
|
||||
service_name = service->s_name;
|
||||
else
|
||||
|
|
@ -268,7 +268,7 @@ void PortList::getServiceDeductions(u16 portno, int protocol, struct serviceDedu
|
|||
|
||||
/* Look up the service name. */
|
||||
*sd = serviceDeductions();
|
||||
service = nmap_getservbyport(portno, IPPROTO2STR(protocol));
|
||||
service = nmap_getservbyport(portno, protocol);
|
||||
if (service != NULL)
|
||||
sd->name = service->s_name;
|
||||
else
|
||||
|
|
@ -337,7 +337,7 @@ void PortList::setServiceProbeResults(u16 portno, int protocol,
|
|||
Just look up the service name if none is provided. */
|
||||
if (sname == NULL) {
|
||||
const struct nservent *service;
|
||||
service = nmap_getservbyport(portno, IPPROTO2STR(protocol));
|
||||
service = nmap_getservbyport(portno, protocol);
|
||||
if (service != NULL)
|
||||
sname = service->s_name;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue