mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-23 01:53:46 +01:00
The port number must be network byte order.
This commit is contained in:
parent
dcd61bb80c
commit
920b61d0bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158289
@ -509,10 +509,9 @@ services(int argc, char *argv[])
|
||||
proto = strchr(argv[i], '/');
|
||||
if (proto != NULL)
|
||||
*proto++ = '\0';
|
||||
if (parsenum(argv[i], &id)) {
|
||||
printf("%lu %s\n", id, proto);
|
||||
se = getservbyport((int)id, proto);
|
||||
} else
|
||||
if (parsenum(argv[i], &id))
|
||||
se = getservbyport(htons((u_short)id), proto);
|
||||
else
|
||||
se = getservbyname(argv[i], proto);
|
||||
if (se != NULL)
|
||||
SERVICESPRINT;
|
||||
|
Loading…
Reference in New Issue
Block a user