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, 4 Sep 2019 17:34:17 +0000 (18:34 +0100)
commit3124f37409ffd4107ffbb5bd52b0da7fc15a7201
tree358a7ffaf6d578e975545206710b377a8f3b8528
parent5f29b41d078593e3f8b8ae8f492f53acd72fd61f
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