if (!tp->chosen)
return;
- chunk_appendf(b, " version_information:(chosen=0x%08x", tp->chosen);
- if (tp->nb_others) {
- int i = 0;
- const uint32_t *ver;
- chunk_appendf(b, ",others=");
- for (ver = tp->others; i < tp->nb_others; i++, ver++) {
- if (i != 0)
- chunk_appendf(b, ",");
- if (local)
- chunk_appendf(b, "0x%08x", *ver);
- else
- chunk_appendf(b, "0x%08x", ntohl(*ver));
- }
- }
- chunk_appendf(b, ")");
+ chunk_appendf(b, " versions:chosen=0x%08x", tp->chosen);
+ if (tp->negotiated_version)
+ chunk_appendf(b, ",negotiated=0x%08x", tp->negotiated_version->num);
}
static inline void quic_transport_params_dump(struct buffer *b,
const unsigned char *end, int server)
{
size_t tp_len = end - *buf;
- const uint32_t *ver;
+ const uint32_t *ver, *others;
/* <tp_len> must be a multiple of sizeof(uint32_t) */
if (tp_len < sizeof tp->chosen || (tp_len & 0x3))
return 0;
*buf += sizeof tp->chosen;
- tp->others = (const uint32_t *)*buf;
+ others = (const uint32_t *)*buf;
/* Others versions must not be null */
- for (ver = tp->others; ver < (const uint32_t *)end; ver++) {
+ for (ver = others; ver < (const uint32_t *)end; ver++) {
if (!*ver)
return 0;
}
/* TODO: not supported */
return 0;
- tp->nb_others = (end - (const unsigned char *)tp->others) / sizeof *tp->others;
- for (ver = tp->others; ver < (const uint32_t *)end; ver++) {
+ for (ver = others; ver < (const uint32_t *)end; ver++) {
if (!tp->negotiated_version) {
int i;