BUG/MINOR: log: fix outgoing abns address family
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Feb 2025 10:03:39 +0000 (11:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Feb 2025 15:22:38 +0000 (16:22 +0100)
commitca0062d303b31d85d363a1322f1b4eff905df032
treea78de21c470f8c11edbb7b91587bfbb7358206c5
parent946048e7ee03eafac94c9e041709876315220a24
BUG/MINOR: log: fix outgoing abns address family

While reviewing the code in an attempt to fix GH #2875, I stumbled
on another case similar to aac570c ("BUG/MEDIUM: uxst: fix outgoing
abns address family in connect()") that caused abns(z) addresses to
fail when used as log targets.

The underlying cause is the same as aac570c, which is the rework of the
unix socket families in order to support custom addresses for different
adressing schemes, where a real_family() was overlooked before passing
a haproxy-internal address struct to socket-oriented syscall.

To fix the issue, we first copy the target's addr, and then leverage
real_family() to set the proper low-level address family that is passed
to sendmsg() syscall.

It should be backported in 3.1

(cherry picked from commit c9d41927266849208508b144ef15809a3a15c6cb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/log.c