diff options
| author | Vladimir Homutov <vl@nginx.com> | 2021-12-16 11:42:28 +0300 |
|---|---|---|
| committer | Vladimir Homutov <vl@nginx.com> | 2021-12-16 11:42:28 +0300 |
| commit | 93230cd8cfbdb4dd8ed293210df73c3227d80bbd (patch) | |
| tree | ad33de41702139d4634e5b9cce6f872bf700b47b /src | |
| parent | fa4da058549d122387f5d553b62b0ec15b84ddc8 (diff) | |
| download | nginx-93230cd8cfbdb4dd8ed293210df73c3227d80bbd.tar.gz nginx-93230cd8cfbdb4dd8ed293210df73c3227d80bbd.tar.bz2 | |
QUIC: added missing check for backup path existence.
Diffstat (limited to 'src')
| -rw-r--r-- | src/event/quic/ngx_event_quic_migration.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/event/quic/ngx_event_quic_migration.c b/src/event/quic/ngx_event_quic_migration.c index 9b1ccafba..592671093 100644 --- a/src/event/quic/ngx_event_quic_migration.c +++ b/src/event/quic/ngx_event_quic_migration.c @@ -81,6 +81,7 @@ ngx_int_t ngx_quic_handle_path_response_frame(ngx_connection_t *c, ngx_quic_path_challenge_frame_t *f) { + ngx_uint_t rst; ngx_queue_t *q; ngx_quic_path_t *path, *prev; ngx_quic_connection_t *qc; @@ -127,13 +128,21 @@ valid: * unless the only change in the peer's address is its port number. */ - prev = qc->backup->path; + rst = 1; - if (ngx_cmp_sockaddr(prev->sockaddr, prev->socklen, - path->sockaddr, path->socklen, 0) - != NGX_OK) - { - /* address has changed */ + if (qc->backup) { + prev = qc->backup->path; + + if (ngx_cmp_sockaddr(prev->sockaddr, prev->socklen, + path->sockaddr, path->socklen, 0) + == NGX_OK) + { + /* address did not change */ + rst = 0; + } + } + + if (rst) { ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t)); qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size, |
