]> git.kaiwu.me - nginx.git/commitdiff
QUIC: discard unrecognized long packes.
authorVladimir Homutov <vl@nginx.com>
Wed, 2 Sep 2020 06:54:15 +0000 (09:54 +0300)
committerVladimir Homutov <vl@nginx.com>
Wed, 2 Sep 2020 06:54:15 +0000 (09:54 +0300)
While there, updated comment about discarded packets.

src/event/ngx_event_quic.c

index 913ffc56dd82d35bec8c0501d8c91e783c06b404..fbc6455a738803326ddcc1b5c98e06692854639d 100644 (file)
@@ -1593,7 +1593,7 @@ ngx_quic_input(ngx_connection_t *c, ngx_buf_t *b)
             } else {
                 ngx_log_error(NGX_LOG_INFO, c->log, 0,
                               "quic unknown long packet type");
-                return NGX_ERROR;
+                rc = NGX_DECLINED;
             }
 
         } else {
@@ -1618,6 +1618,9 @@ ngx_quic_input(ngx_connection_t *c, ngx_buf_t *b)
          * not available or any other reason), the receiver MAY either
          * discard or buffer the packet for later processing and MUST
          * attempt to process the remaining packets.
+         *
+         * We also skip packets that don't match connection state
+         * or cannot be parsed properly.
          */
 
         /* b->pos is at header end, adjust by actual packet length */