aboutsummaryrefslogtreecommitdiff
path: root/src/event/quic/ngx_event_quic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event/quic/ngx_event_quic.c')
-rw-r--r--src/event/quic/ngx_event_quic.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c
index 53e50a8b9..03d703b2c 100644
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -812,11 +812,6 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
return NGX_DECLINED;
}
- rc = ngx_quic_check_migration(c, pkt);
- if (rc != NGX_OK) {
- return rc;
- }
-
if (pkt->level != ssl_encryption_application) {
if (pkt->version != qc->version) {
@@ -825,6 +820,18 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
return NGX_DECLINED;
}
+ if (pkt->first) {
+ if (ngx_quic_find_path(c, c->udp->dgram->sockaddr,
+ c->udp->dgram->socklen)
+ == NULL)
+ {
+ /* packet comes from unknown path, possibly migration */
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic too early migration attempt");
+ return NGX_DECLINED;
+ }
+ }
+
if (ngx_quic_check_csid(qc, pkt) != NGX_OK) {
return NGX_DECLINED;
}