]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: protocol: add a ->set_port() helper to address families
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2020 13:43:36 +0000 (14:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2020 14:08:00 +0000 (15:08 +0100)
commit73bed9ff135472c0e02b5aba08845b8a359eb268
treef24cb63db67105c8ff17dfd3dd130bcf81c8e13d
parentc31bc724d4e6793c8a543d03e3b4f968d6fcba29
MINOR: protocol: add a ->set_port() helper to address families

At various places we need to set a port on an IPv4 or IPv6 address, and
it requires casts that are easy to get wrong. Let's add a new set_port()
helper to the address family to assist in this. It will be directly
accessible from the protocol and will make the operation seamless.
Right now this is only implemented for sock_inet as other families do
not need a port.
include/haproxy/protocol-t.h
include/haproxy/sock_inet.h
src/sock_inet.c