BUG/MINOR: quic_tp: fix preferred_address decoding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 30 Nov 2023 13:01:51 +0000 (14:01 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 30 Nov 2023 14:49:10 +0000 (15:49 +0100)
commita9ad68aa74bbb62b7ae1d8594b9da4489d65bd9e
tree1c5731338bddd6944b6c5e0156c9a266353fffb8
parentf31719edae656198891e5ad6eace990f8473000e
BUG/MINOR: quic_tp: fix preferred_address decoding

quic_transport_param_dec_pref_addr() is responsible to decode
preferred_address from received transport parameter. There was two
issues with this function :
* address and port location as defined in RFC were inverted for both
  IPv4 and IPv6 during decoding
* an invalid check was done to ensure decoded CID length corresponds to
  remaining buffer size. It did not take into account the final field
  for stateless reset token.

These issues were never encountered as only server can emit
preferred_address transport parameter, so the impact of this bug is
invisible.

This should be backported up to 2.6.
src/quic_tp.c