]> git.kaiwu.me - nginx.git/commitdiff
Rejecting new connections with non-zero Initial packet.
authorSergey Kandaurov <pluknet@nginx.com>
Mon, 6 Apr 2020 11:54:10 +0000 (14:54 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Mon, 6 Apr 2020 11:54:10 +0000 (14:54 +0300)
src/event/ngx_event_quic.c

index ebb9b24afaf8839032db276e17d811c6350e464a..b96af808d4eae0d064ce85d27d14bafd5dfefaa0 100644 (file)
@@ -531,6 +531,12 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp,
         return NGX_ERROR;
     }
 
+    if (pkt->pn != 0) {
+        ngx_log_error(NGX_LOG_INFO, c->log, 0,
+                      "invalid initial packet number %L", pkt->pn);
+        return NGX_ERROR;
+    }
+
     if (ngx_quic_init_connection(c) != NGX_OK) {
         return NGX_ERROR;
     }