Re: poll(2) semantics changed in 2.4.0-? vs. 2.2.16?

From: Martin Diehl (mdiehlcs@compuserve.de)
Date: Thu Oct 05 2000 - 19:13:45 EST


On Thu, 5 Oct 2000, David S. Miller wrote:

> Fix your /etc/nsswitch.conf to not try to use NIS/NIS+ if you
> do not have these services available.

Yes, of course you are right - incorrect nsswitch.conf will reveal this
problem too - but:
No, the issue I've tried to demonstrate with my polltest.c program is
completely independent. The point is:

udp-sendmsg() to an unbound port on reachable peer (localhost:12345 e.g. -
will try eth0 too) results in returning icmp: port unreachable. Ok so far.
The following poll() on the sending fd should IMHO immediately return
POLLERR due to pending ECONNREFUSED instead of blocking until timeout -
right? At least, that is the behavior described in man udp(4)/RFC1122 and
realized in 2.2.16 (at least since 2.0.x I think and probably up to
2.2.18pre?, as long as there is no corresponding 2.4 backport there,
I believe - not tested). It's still working this way if I add a sleep(5)
or so between sendto() and poll() in 2.2. Setting or unsetting
SO_BSDCOMPAT doesn't change anything either.

For 2.4.0-test9 however the poll() ignores the returned (still pending)
icmp error and blocks until timeout (or forever), no matter if
SO_BSDCOMPAT is set or not.

So, for me the 2.4.0-test9 behavior does not only differ from 2.2 and what
manpages say - I'm just wondering how to detect the unreachable peer port?
poll()-timeout means no response at all, which is sth different and forces
blocking for some time. Nonblocking recvfrom() without poll() wouldn't
help, since the pending error isn't passed to it either.

Sorry if my first post wasn't clear enough wrt that what I meant - a
general poll() semantics question - which indeed might be hit pretty
hard by incorrect /etc/nsswitch configuration for example.

Regards,
Martin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:18 EST