]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: move IP_PKTINFO on send on a dedicated function
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 19 Feb 2024 14:21:13 +0000 (15:21 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 20 Feb 2024 15:42:05 +0000 (16:42 +0100)
commitea90c3930222ce714764a732ff022e1756b329a5
treef8e589e2c68efbd9872b6d731e9b470b58940513
parent107d6d75465419a09d90c790edb617091a04468a
MINOR: quic: move IP_PKTINFO on send on a dedicated function

When using listener socket, source address for emission is explicitely
set using ancillary data for sendmsg(). This is useful to guarantee the
correct address is used when binding on a non-explicit address.

This code was implemented directly under qc_snd_buf(). However, it is
quite complex due to portability issue. For IPv4, two parallel
implementations coexist, defined under IP_PKTINFO or IP_RECVDSTADDR. For
IPv6, another option is defined under IPV6_RECVPKTINFO. Each variant
uses its distinct name which increase the code complexity.

Extract ancillary data filling in a dedicated function named
cmsg_set_saddr(). This reduces greatly the body of qc_snd_buf(). Such
functions can be replicated when other ancillary data type will be
implemented. This will notably be useful for GSO implementation.
src/quic_sock.c