From: Yeonggi Kim <[email protected]>
Retry, Version Negotiation and Stateless Reset packets are emitted
without connection via quic_lstnr_sock_send(). If sendmsg() is
interrupted by a signal, the error is reported to the caller and the
packet is lost, while qc_snd_buf() retries the emission on EINTR.
Also retry the emission on EINTR in quic_lstnr_sock_send(). The impact
is limited, as the listener socket is non-blocking so sendmsg() is not
expected to be interrupted in practice, and a new packet will be
emitted in response to the next ones from the peer.
This may be backported along with the previous patches up to 2.8.
---
src/quic_sock.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/quic_sock.c b/src/quic_sock.c
index b4ea07eed..2af4b8f3e 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -837,6 +837,7 @@ ssize_t quic_lstnr_sock_send(struct listener *l, const void
*buf, size_t len,
struct sockaddr_storage *src,
struct sockaddr_storage *dst)
{
+ ssize_t ret;
struct msghdr msg;
struct iovec vec;
struct cmsghdr *cmsg = NULL;
@@ -871,7 +872,11 @@ ssize_t quic_lstnr_sock_send(struct listener *l, const
void *buf, size_t len,
cmsg_set_saddr(&msg, &cmsg, src);
}
- return sendmsg(l->rx.fd, &msg, 0);
+ do {
+ ret = sendmsg(l->rx.fd, &msg, 0);
+ } while (ret < 0 && errno == EINTR);
+
+ return ret;
}
/* Receive datagram on <qc> FD-owned socket.
--
2.50.1 (Apple Git-155)