From fafeaf661a27e4e7828e96d3ddee1fd2638a7a2d Mon Sep 17 00:00:00 2001 From: Petrus Hellgren Date: Tue, 25 Apr 2017 10:39:09 +0200 Subject: [PATCH] inetd: remove ntoh on proto getprotobyname() returns p_proto in host endian, so it should not be converted with ntoh. (Note: getservbyname() on the other hand does return s_port in network endian) Signed-off-by: Petrus Hellgren --- src/inetd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inetd.c b/src/inetd.c index 0733d288..b47f3b73 100644 --- a/src/inetd.c +++ b/src/inetd.c @@ -573,7 +573,7 @@ int inetd_match(inetd_t *inetd, char *service, char *proto) if (getent(service, proto, &sv, &pv)) return 0; - if (inetd->proto == ntohs(pv->p_proto) && + if (inetd->proto == pv->p_proto && inetd->port == ntohs(sv->s_port)) return 1;