Mercurial > hg > nginx
changeset 8542:d3489d225f8f quic
QUIC: update packet length for short packets too.
During long packet header parsing, pkt->len is updated with the Length
field value that is used to find next coalesced packets in a datagram.
For short packets it still contained the whole QUIC packet size.
This change uniforms packet length handling to always contain the total
length of the packet number and protected packet payload in pkt->len.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 08 Sep 2020 13:27:39 +0300 |
parents | dcbb58e7ed11 |
children | 9aedab0f0dff |
files | src/event/ngx_event_quic_protection.c src/event/ngx_event_quic_transport.c |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_quic_protection.c Mon Sep 07 20:55:36 2020 +0300 +++ b/src/event/ngx_event_quic_protection.c Tue Sep 08 13:27:39 2020 +0300 @@ -1058,13 +1058,12 @@ /* packet protection */ in.data = p; + in.len = pkt->len - pnl; if (ngx_quic_long_pkt(pkt->flags)) { - in.len = pkt->len - pnl; badflags = clearflags & NGX_QUIC_PKT_LONG_RESERVED_BIT; } else { - in.len = pkt->data + pkt->len - p; badflags = clearflags & NGX_QUIC_PKT_SHORT_RESERVED_BIT; }