]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: quic: handle EINTR on emission of packets without connection
authorYeonggi Kim <yg.kim@navercorp.com>
Thu, 15 Oct 2026 23:45:58 +0000 (08:45 +0900)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 16 Oct 2026 07:31:06 +0000 (09:31 +0200)
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

index b4ea07eedc6098688ef8257cb0726a7b3e28f6b1..2af4b8f3e8370f53df0f3656851b9d064d9d7dd3 100644 (file)
@@ -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.