changeset 8535:eb5aa85294e9 quic

QUIC: discard unrecognized long packes. While there, updated comment about discarded packets.
author Vladimir Homutov <vl@nginx.com>
date Wed, 02 Sep 2020 09:54:15 +0300
parents 985f9351dd87
children c6b963de0c00
files src/event/ngx_event_quic.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -1593,7 +1593,7 @@ ngx_quic_input(ngx_connection_t *c, ngx_
             } 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_
          * 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 */