[systemd-devel] xinetd REMOTE_IP (feature request)

Mantas Mikulėnas grawity at gmail.com
Thu Nov 13 11:12:22 PST 2014


On Thu, Nov 13, 2014 at 8:58 PM, Tomasz Torcz <tomek at pipebreaker.pl> wrote:

> On Thu, Nov 13, 2014 at 01:53:12PM -0500, Fisher, Charles J. (Top Echelon)
> wrote:
> > The xinetd server from previous versions of RedHat defined a REMOTE_IP
> environment variable.
> >
> > I realize that I can extract that data with the following code:
> >
> > {
> > struct sockaddr_in thisconn;
> > int thislen = sizeof(thisconn);
> > getpeername( /* STDIN */ 0, &thisconn, &thislen);
> > printf("%s\n", inet_ntoa(thisconn.sin_addr));
> > }
> >
> > ...but it would be nice if the behavior matched xinetd.
>
>   You can do it in shell by parsing instance name embedded
> in /proc/self/cgroup
>

I'm not sure whether the instance names are something that should be relied
on?

(Not to mention that it'll probably take twice as much code as
getpeername().)

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141113/b4d4c316/attachment.html>


More information about the systemd-devel mailing list