[master] c3310c64f vtc_http2: Restrict SETTINGS frames to stream 0

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jan 31 11:47:06 UTC 2023


commit c3310c64f44146d66b64493108a951bfa5ae7196
Author: Walid Boudebouda <walid.boudebouda at gmail.com>
Date:   Mon Dec 5 18:16:21 2022 +0100

    vtc_http2: Restrict SETTINGS frames to stream 0
    
    In the unlikely event that we ever need actual coverage for this case,
    we can handle it better than just failing the test case. In that regard,
    as long as varnishtest itself can send SETTINGS frame on a wrong stream
    to test varnishd's behavior, we should be fine.
    
    Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 6a9a4de03..d2ec55a65 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -607,6 +607,10 @@ parse_settings(const struct stream *s, struct frame *f)
 		vtc_fatal(s->vl,
 		    "Size should be a multiple of 6, but isn't (%d)", f->size);
 
+	if (s->id != 0)
+		vtc_fatal(s->vl,
+		    "Setting frames should only be on stream 0, but received on stream: %d", s->id);
+
 	for (u = 0; u <= SETTINGS_MAX; u++)
 		f->md.settings[u] = NAN;
 


More information about the varnish-commit mailing list