socket-util: make sure flush_accept() doesn't hang on unexpected EOPNOTSUPP
authorLennart Poettering <lennart@poettering.net>
Thu, 18 Apr 2019 13:13:54 +0000 (15:13 +0200)
committerMichael Biebl <biebl@debian.org>
Wed, 21 Aug 2019 20:09:13 +0000 (21:09 +0100)
commit9bc8f4b308dd7cb37033fefc2dee90a321e6901e
treef1a400feb804e1bc3142cb879d73c3c5c71fdc5a
parent1cb0ab010c3d5e0cf65c4165857fa43d10e30499
socket-util: make sure flush_accept() doesn't hang on unexpected EOPNOTSUPP

So apparently there are two reasons why accept() can return EOPNOTSUPP:
because the socket is not a listening stream socket (or similar), or
because the incoming TCP connection for some reason wasn't acceptable to
the host. THe latter should be a transient error, as suggested on
accept(2). The former however should be considered fatal for
flush_accept(). Let's fix this by explicitly checking whether the socket
is a listening socket beforehand.

(cherry picked from commit f3d75364fbebf2ddb6393e54db5e10b6f6234e14)

Gbp-Pq: Name socket-util-make-sure-flush_accept-doesn-t-hang-on-unexpe.patch
src/basic/socket-util.c