summaryrefslogtreecommitdiffhomepage
path: root/src/event/quic/ngx_event_quic_migration.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2021-12-13 09:48:33 +0300
committerVladimir Homutov <vl@nginx.com>2021-12-13 09:48:33 +0300
commit10fd8be86d657839fbc6218891bfe9046ab5b592 (patch)
treee791bd99093c559ca1dcd3a7e93510cf175dadad /src/event/quic/ngx_event_quic_migration.c
parenta31745499bcf35fac236bdc5f3d0d0a6d679b4e0 (diff)
downloadnginx-10fd8be86d657839fbc6218891bfe9046ab5b592.tar.gz
nginx-10fd8be86d657839fbc6218891bfe9046ab5b592.tar.bz2
QUIC: decoupled path state and limitation status.
The path validation status and anti-amplification limit status is actually two different variables. It is possible that validating path should not be limited (for example, when re-validating former path).
Diffstat (limited to 'src/event/quic/ngx_event_quic_migration.c')
-rw-r--r--src/event/quic/ngx_event_quic_migration.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/event/quic/ngx_event_quic_migration.c b/src/event/quic/ngx_event_quic_migration.c
index 0bfee6058..9b1ccafba 100644
--- a/src/event/quic/ngx_event_quic_migration.c
+++ b/src/event/quic/ngx_event_quic_migration.c
@@ -158,6 +158,7 @@ valid:
"quic path #%uL successfully validated", path->seqnum);
path->state = NGX_QUIC_PATH_VALIDATED;
+ path->limited = 0;
return NGX_OK;
}
@@ -215,6 +216,9 @@ ngx_quic_add_path(ngx_connection_t *c, struct sockaddr *sockaddr,
return NULL;
}
+ path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
+
path->seqnum = qc->path_seqnum++;
path->last_seen = ngx_current_msec;
@@ -332,6 +336,7 @@ update:
/* force limits/revalidation for paths that were not seen recently */
if (ngx_current_msec - path->last_seen > qc->tp.max_idle_timeout) {
path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
path->sent = 0;
path->received = 0;
}
@@ -350,11 +355,11 @@ update:
*/
path->received += len;
- ngx_log_debug6(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ ngx_log_debug7(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic packet via #%uL:%uL:%uL"
- " size:%O path recvd:%O sent:%O",
+ " size:%O path recvd:%O sent:%O limited:%ui",
qsock->sid.seqnum, qsock->cid->seqnum, path->seqnum,
- len, path->received, path->sent);
+ len, path->received, path->sent, path->limited);
return NGX_OK;
}
@@ -607,6 +612,7 @@ ngx_quic_path_validation_handler(ngx_event_t *ev)
/* found expired path */
path->state = NGX_QUIC_PATH_NEW;
+ path->limited = 1;
/*
* RFC 9000, 9.4. Loss Detection and Congestion Control