]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: protocol: add get_src() and get_dst() at the protocol level
authorWilly Tarreau <w@1wt.eu>
Fri, 8 Apr 2022 11:49:17 +0000 (13:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Apr 2022 17:33:04 +0000 (19:33 +0200)
commite151609110913b1c9c8d83c991c39a76582d659e
treea8a3c4827132a2bc1b0e370a07a496ab2df5c110
parent987c08a5e2023ad3dffc9ff21701bc59e174d253
MINOR: protocol: add get_src() and get_dst() at the protocol level

Right now the proto_fam descriptor provides a family-specific
get_src() and get_dst() pair of calls to retrieve a socket's source
or destination address. However this only works for connected mode
sockets. QUIC provides its own stream protocol, which relies on a
datagram protocol underneath, so the get_src()/get_dst() at that
protocol's family will not work, and QUIC would need to provide its
own.

This patch implements get_src() and get_dst() at the protocol level
from a connection, and makes sure that conn_get_src()/conn_get_dst()
will automatically use them if defined before falling back to the
family's pair of functions.
include/haproxy/connection.h
include/haproxy/protocol-t.h