From: Patrick Hemmer Date: Tue, 1 Aug 2023 14:55:55 +0000 (-0400) Subject: BUG/MINOR: cfgparse: use curproxy global var from config post validation X-Git-Tag: v3.0-dev11~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28489021b334584bbfc3405447d61ce05c088c7c;p=thirdparty%2Fhaproxy.git BUG/MINOR: cfgparse: use curproxy global var from config post validation Previously check_config_validity() had its own curproxy variable. This resulted in the acl() sample fetch being unable to determine which proxy was in use when used from within log-format statements. This change addresses the issue by having the check_config_validity() function use the global variable instead. --- diff --git a/reg-tests/sample_fetches/acl.vtc b/reg-tests/sample_fetches/acl.vtc index 21e6f4b524..905ae3ecf4 100644 --- a/reg-tests/sample_fetches/acl.vtc +++ b/reg-tests/sample_fetches/acl.vtc @@ -19,6 +19,8 @@ haproxy h1 -conf { acl ACL4 acl(ACL2,!ACL3) http-request return status 200 hdr x-acl "ACL1=%[acl(ACL1)] ACL2=%[acl(ACL2)] ACL3=%[acl(ACL3)] ACL4=%[acl(ACL4)] TRUE=%[acl(TRUE)]" + + log-format ACL1=%[acl(ACL1)] } -start client c1 -connect ${h1_fe1_sock} { diff --git a/src/cfgparse.c b/src/cfgparse.c index 6e5055e37e..c09d964354 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2705,7 +2705,6 @@ static int numa_detect_topology() int check_config_validity() { int cfgerr = 0; - struct proxy *curproxy = NULL; struct proxy *init_proxies_list = NULL; struct stktable *t; struct server *newsrv = NULL;