Is ngx_quic_select_socket_by_dcid good when len < 20 ?

Gao,Yan(ACG VCP) gaoyan09 at baidu.com
Tue Mar 9 07:13:53 UTC 2021


ngx_quic_select_socket_by_dcid

    advance_data(sizeof(struct udphdr)); /* skip UDP header */
    advance_data(1); /* QUIC flags */

    if (data[0] & NGX_QUIC_PKT_LONG) {

        advance_data(4); /* skip QUIC version */
        len = data[0];   /* read DCID length */

        if (len < 8) {
            /* it's useless to search for key in such short DCID */
            return SK_PASS;
        }

        advance_data(1); /* skip DCID len */

    } else {
        len = NGX_QUIC_SERVER_CID_LEN;
    }

dcid = &data[1];
advance_data(len); /* we expect the packet to have full DCID */

len = data[0];   /* read DCID length */
advance_data(1); /* skip DCID len */
dcid = &data[1];

len = data[0] and dcid = &data[1] should both move after advance_data(1)  or before advance_data(1)

is ngx_quic_parse_uint64(dcid) good when len < 20 ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20210309/722a5d71/attachment.htm>


More information about the nginx-devel mailing list