mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 09:24:31 +00:00
BUG/MINOR: stick-table: fix crash for src_inc_gpc() without stkcounter
Since 2.5, an array of GPC is provided to replace legacy gpc0/gpc1.
src_inc_gpc is a sample fetch which is used to increment counters in
this array.
A crash occurs if src_inc_gpc is used without any previous track-sc
rule. This is caused by an error in smp_fetch_sc_inc_gpc(). When
temporary stick counter is created via smp_create_src_stkctr(), table
pointer arg value used is not correct : it points to the counter ID
instead of the table argument. To fix this, use the proper sample fetch
second arg.
This can be reproduced with the following config :
acl mark src_inc_gpc(0,<table>) -m bool
tcp-request connection accept if mark
This should be backported up to 2.6.
(cherry picked from commit ea7ea5198a
)
Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
parent
8a77ac322f
commit
69dfddcf42
@ -3963,7 +3963,7 @@ smp_fetch_sc_inc_gpc(const struct arg *args, struct sample *smp, const char *kw,
|
||||
smp->data.u.sint = 0;
|
||||
|
||||
if (!stkctr_entry(stkctr))
|
||||
stkctr = smp_create_src_stkctr(smp->sess, smp->strm, args, kw, &tmpstkctr);
|
||||
stkctr = smp_create_src_stkctr(smp->sess, smp->strm, args + 1, kw, &tmpstkctr);
|
||||
|
||||
if (stkctr && stkctr_entry(stkctr)) {
|
||||
void *ptr1,*ptr2;
|
||||
|
Loading…
Reference in New Issue
Block a user