[PATCH][BZ #14719] Return EAI_SYSTEM from getaddrinfo if we run out of fds
Dmitry V. Levin
ldv@altlinux.org
Mon Apr 8 13:26:00 GMT 2013
On Mon, Apr 08, 2013 at 10:57:13AM +0530, Siddhesh Poyarekar wrote:
> On Mon, Apr 08, 2013 at 07:36:14AM +0400, Dmitry V. Levin wrote:
> > There is a slightly different case when it also shouldn't be EAI_SYSTEM:
> >
> > $ strace -econnect,sendto ./t
> > ...
> > connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.0.43.10")}, 16) = 0
> > sendto(3, "\317I\1\0\0\1\0\0\0\0\0\0\7example\3net\0\0\1\0\1", 29, MSG_NOSIGNAL, NULL, 0) = -1 EPERM (Operation not permitted)
> > ...
> > System error: Resource temporarily unavailable
> > +++ exited with 1 +++
> >
> > Such an environment could be constructed, e.g. by filtering outgoing
> > packets using iptables (-j REJECT --reject-with icmp-net-unreachable).
> >
>
> Have you tried this with the patch I posted[1] last week? I get
> EAI_NONAME with my patch.
Yes, your patch passes the first (unshare -n) test: if connect fails with
ENETUNREACH, getaddrinfo returns EAI_NONAME with errno set to ECONNREFUSED.
But if sendto fails with EPERM, getaddrinfo returns EAI_SYSTEM with errno
set to EAGAIN.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130408/17a540d1/attachment.sig>
More information about the Libc-alpha
mailing list