From: Amaury Denoyelle Date: Wed, 18 May 2022 16:26:13 +0000 (+0200) Subject: MINOR: quic: abort on unlisted errno on sendto() X-Git-Tag: v2.6-dev11~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5df386d9d5b3bc3b490dccf6fc08992063c0fb;p=thirdparty%2Fhaproxy.git MINOR: quic: abort on unlisted errno on sendto() If an unlisted errno is reported, abort the process. If a crash is reported on this condition, we must determine if the error code is a bug, should interrupt emission on the fd or if we can retry the syscall. --- diff --git a/src/quic_sock.c b/src/quic_sock.c index 71fe0b7f59..e56372ed60 100644 --- a/src/quic_sock.c +++ b/src/quic_sock.c @@ -339,14 +339,18 @@ size_t qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t count, if (ret < try) break; } + else if (errno == EINTR) { + /* try again */ + continue; + } else if (ret == 0 || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN || errno == EINPROGRESS) { /* TODO must be handle properly. It is justified for UDP ? */ qc->sendto_err++; break; } - else if (errno != EINTR) { - /* TODO must be handle properly. It is justified for UDP ? */ - qc->sendto_err++; + else if (errno) { + /* TODO unlisted errno : handle it explicitely. */ + ABORT_NOW(); } }