]> git.kaiwu.me - nginx.git/commitdiff
QUIC: fixed config test with bpf (ticket #2292).
authorVladimir Homutov <vl@nginx.com>
Tue, 28 Dec 2021 10:24:58 +0000 (13:24 +0300)
committerVladimir Homutov <vl@nginx.com>
Tue, 28 Dec 2021 10:24:58 +0000 (13:24 +0300)
The SO_REUSEPORT socket option is not set during configuration testing,
thus making the further module initialization impossible and meaningless.

src/event/quic/ngx_event_quic_bpf.c

index 848a64d599c45aba3bc39503e56efd373d5f9af8..ab024ad5601c811ba42e8e1a2ad3564d51bb6d5e 100644 (file)
@@ -130,6 +130,14 @@ ngx_quic_bpf_module_init(ngx_cycle_t *cycle)
     ngx_pool_cleanup_t   *cln;
     ngx_quic_bpf_conf_t  *bcf;
 
+    if (ngx_test_config) {
+        /*
+         * during config test, SO_REUSEPORT socket option is
+         * not set, thus making further processing meaningless
+         */
+        return NGX_OK;
+    }
+
     ccf = ngx_core_get_conf(cycle);
     bcf = ngx_quic_bpf_get_conf(cycle);