BUG/MINOR: listener: use sockaddr_in6 for IPv6
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2020 13:28:23 +0000 (14:28 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 08:25:34 +0000 (09:25 +0100)
commit87c69e5b2b174d0d74cad0618f64e5aa2ceaf16e
treedd3b5f145e37f5bb3c46fce1bcd4f4df44b9e87d
parente85c4cbc82a758fe84c1f18797b89797bcf2c8fc
BUG/MINOR: listener: use sockaddr_in6 for IPv6

A copy-paste bug between {tcp,udp}{4,6}_add_listener() resulted in
using a struct sockaddr_in to set the TCP/UDP port while it ought to
be a struct sockaddr_in6. Fortunately, the port has the same offset
(2) in both so it was harmless. A cleaner way to proceed would be
to have a set_port function exported by the address family layer.

This needs to be backported to 2.3.

(cherry picked from commit 7da02dd308baa40df43b87b5fdca3af8c49e48a8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/proto_tcp.c
src/proto_udp.c