[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] [PATCH] Allow port numbers in inetd.conf
From: |
Jeroen Dekkers |
Subject: |
Re: [bug-inetutils] [PATCH] Allow port numbers in inetd.conf |
Date: |
Sat, 24 Apr 2004 21:37:53 +0200 |
User-agent: |
Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Sat, 24 Apr 2004 14:11:25 +0200,
Robert Millan wrote:
> I'm attaching a patch, made by Tollef Fog Heen <address@hidden>, for
> allowing port numbers in inetd.conf.
>
> 2004-04-24 Tollef Fog Heen <address@hidden>
>
> * inetd/inetd.c: Allow use of port numbers.
<SNIP>
> + port = strtol(sep->se_service, NULL, 10);
> + if (port > 0)
> + {
> + sp = malloc(sizeof(struct servent));
> + if (!sp)
> + {
> + syslog (LOG_ERR, strerror (errno));
> + continue;
> + }
> + asprintf(&(sp->s_name), "%d", port);
> + sp->s_aliases = NULL;
> + sp->s_port = htons(port);
> + sp->s_proto = strdup(sep->se_proto);
> + }
Why don't you use getservbyport()? Oh, by the way, my patch for IPv6
already does this, because getaddrinfo() resolves both names and
numbers.
Jeroen Dekkers