]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: retrieve frontend destination address
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 23 Sep 2022 15:15:58 +0000 (17:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 10 Oct 2022 09:48:27 +0000 (11:48 +0200)
commit97ecc7a8ea5339a753507c3d4e4cd83028c6d038
tree3e6bb36ac62d4fbadf588e22f0a6f49d59ed92e2
parent90121b3321512a74df1a5349c0f99fa2ccd0c017
MEDIUM: quic: retrieve frontend destination address

Retrieve the frontend destination address for a QUIC connection. This
address is retrieve from the first received datagram and then stored in
the associated quic-conn.

This feature relies on IP_PKTINFO or affiliated flags support on the
socket. This flag is set for each QUIC listeners in
sock_inet_bind_receiver(). To retrieve the destination address,
recvfrom() has been replaced by recvmsg() syscall. This operation and
parsing of msghdr structure has been extracted in a wrapper quic_recv().

This change is useful to finalize the implementation of 'dst' sample
fetch. As such, quic_sock_get_dst() has been edited to return local
address from the quic-conn. As a best effort, if local address is not
available due to kernel non-support of IP_PKTINFO, address of the
listener is returned instead.

This should be backported up to 2.6.
include/haproxy/quic_conn-t.h
src/quic_conn.c
src/quic_sock.c
src/sock_inet.c