]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: use hash_ipanon to anonymized address
authorErwan Le Goas <elegoas@haproxy.com>
Thu, 29 Sep 2022 08:27:33 +0000 (10:27 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 08:53:14 +0000 (10:53 +0200)
Replace HA_ANON_CLI by hash_ipanon to anonynmized address like
anonymizing address in the configuration file.

No backport needed, except if anonymization mechanism is backported.

src/proxy.c

index 7c50b4beb6d3182401115515c59f504fcef3080a..6d59c838d41386ed673f63b34b11291475984a31 100644 (file)
@@ -2790,7 +2790,8 @@ static int dump_servers_state(struct stconn *sc)
                                     "%s %s %d"
                                     "\n",
                                     px->uuid, HA_ANON_CLI(px->id),
-                                    srv->puid, HA_ANON_CLI(srv->id), HA_ANON_CLI(srv_addr),
+                                    srv->puid, HA_ANON_CLI(srv->id),
+                                    hash_ipanon(appctx->cli_anon_key, srv_addr, 0),
                                     srv->cur_state, srv->cur_admin, srv->uweight, srv->iweight,
                                     (long int)srv_time_since_last_change,
                                     srv->check.status, srv->check.result, srv->check.health,
@@ -2805,7 +2806,7 @@ static int dump_servers_state(struct stconn *sc)
                        chunk_printf(&trash,
                                     "%s/%s %d/%d %s %u - %u %u %u %u %u %u %d %u",
                                     HA_ANON_CLI(px->id), HA_ANON_CLI(srv->id),
-                                    px->uuid, srv->puid, HA_ANON_CLI(srv_addr),
+                                    px->uuid, srv->puid, hash_ipanon(appctx->cli_anon_key, srv_addr, 0),
                                     srv->svc_port, srv->pool_purge_delay,
                                     srv->curr_used_conns, srv->max_used_conns, srv->est_need_conns,
                                     srv->curr_idle_nb, srv->curr_safe_nb, (int)srv->max_idle_conns, srv->curr_idle_conns);