aboutsummaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/inetd.c')
-rw-r--r--networking/inetd.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index d225527a9..24415fe7d 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -610,19 +610,13 @@ static void config(int signum)
sep->se_ctrladdr_in.sin_family = AF_INET;
sep->se_ctrladdr_size = sizeof sep->se_ctrladdr_in;
{
- u_short port = htons(atoi(sep->se_service));
-
- if (!port) {
- struct servent *sp;
- sp = getservbyname(sep->se_service,
- sep->se_proto);
- if (sp == 0) {
- syslog(LOG_ERR,
- "%s/%s: unknown service",
- sep->se_service, sep->se_proto);
- continue;
- }
- port = sp->s_port;
+ u_short port = bb_lookup_port(sep->se_service, sep->se_proto, 0);
+
+ if (port == 0) {
+ syslog(LOG_ERR,
+ "%s/%s: unknown service",
+ sep->se_service, sep->se_proto);
+ continue;
}
if (port != sep->se_ctrladdr_in.sin_port) {
sep->se_ctrladdr_in.sin_port = port;