]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sample: Fix output type of c_ipv62ip
authorTim Duesterhus <tim@bastelstu.be>
Thu, 25 Jan 2018 15:24:46 +0000 (16:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Jan 2018 21:25:40 +0000 (22:25 +0100)
c_ipv62ip failed to set the output type of the cast to SMP_T_IPV4
even for a successful conversion.

This bug exists as of commit cc4d1716a2e72516c2505a6459a9ddbbfb186da2
which is the first commit adding this function.

v1.6-dev4 is the first tag containing this commit, the fix should
be backported to haproxy 1.6 and newer.

src/sample.c

index 7ac2ec37b6a8302f5b2ce70aea2277833f48bfc9..8de076b5cc7c8d18cdfee7c3e485f918452c3e49 100644 (file)
@@ -531,7 +531,7 @@ static int c_ipv62ip(struct sample *smp)
 {
        if (!v6tov4(&smp->data.u.ipv4, &smp->data.u.ipv6))
                return 0;
-       smp->data.type = SMP_T_IPV6;
+       smp->data.type = SMP_T_IPV4;
        return 1;
 }