From: Aurelien DARRAGON Date: Wed, 7 Jun 2023 13:12:06 +0000 (+0200) Subject: BUG/MINOR: tcp_sample: bc_{dst,src} return IP not INT X-Git-Tag: v2.9-dev2~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=461fd2e29616eb27f6a66ca66311076366423527;p=thirdparty%2Fhaproxy.git BUG/MINOR: tcp_sample: bc_{dst,src} return IP not INT bc_{dst,src} sample fetches were introduced in 7d081f0 ("MINOR: tcp_samples: Add samples to get src/dst info of the backend connection") However a copy-pasting error was probably made here because they both return IP addresses (not integers) like their fc_{src,dst} or src,dst analogs. Hopefully, this had no functional impact because integer can be converted to both IPV4 and IPV6 types so the compatibility checks were not affected. Better fix this to prevent confusion in code and "haproxy -dKsmp" output. This should be backported up to 2.4 with 7d081f0. --- diff --git a/src/tcp_sample.c b/src/tcp_sample.c index 393e39e93d..ee66ed1626 100644 --- a/src/tcp_sample.c +++ b/src/tcp_sample.c @@ -503,9 +503,9 @@ smp_fetch_fc_reordering(const struct arg *args, struct sample *smp, const char * * instance v4/v6 must be declared v4. */ static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, { - { "bc_dst", smp_fetch_dst, 0, NULL, SMP_T_SINT, SMP_USE_L4SRV }, + { "bc_dst", smp_fetch_dst, 0, NULL, SMP_T_IPV4, SMP_USE_L4SRV }, { "bc_dst_port", smp_fetch_dport, 0, NULL, SMP_T_SINT, SMP_USE_L4SRV }, - { "bc_src", smp_fetch_src, 0, NULL, SMP_T_SINT, SMP_USE_L4SRV }, + { "bc_src", smp_fetch_src, 0, NULL, SMP_T_IPV4, SMP_USE_L4SRV }, { "bc_src_port", smp_fetch_sport, 0, NULL, SMP_T_SINT, SMP_USE_L4SRV }, { "dst", smp_fetch_dst, 0, NULL, SMP_T_IPV4, SMP_USE_L4CLI },