]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: stress CRYPTO Rx buffer wrapping
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 Aug 2026 14:29:19 +0000 (16:29 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 Aug 2026 14:29:19 +0000 (16:29 +0200)
Force CRYPTO Rx buffer to be unaligned when running under stress. Most
of the time, this will cause a connection error with
CRYPTO_BUFFER_EXCEEDED as CRYPTO wrapping is not yet implemented.

include/haproxy/quic_conn.h

index 3424389a243659d5e55111dca08f23c288a618d6..183dfdba904b2216cc68c8a45e904a9a0a0869fe 100644 (file)
@@ -50,6 +50,7 @@
 #include <haproxy/quic_rx.h>
 #include <haproxy/quic_tune.h>
 #include <haproxy/mux_quic.h>
+#include <haproxy/stress.h>
 
 #include <openssl/rand.h>
 
@@ -156,7 +157,8 @@ static inline struct ncbmbuf *quic_get_ncbuf(struct ncbmbuf *ncbuf)
                return NULL;
 
        *ncbuf = ncbmb_make(buf.area, buf.size, 0);
-       ncbmb_init(ncbuf, 0);
+       STRESS_RUN5(ncbmb_init(ncbuf, ncbmb_size(ncbuf) - 256),
+                   ncbmb_init(ncbuf, 0));
 
        return ncbuf;
 }