BUG/MINOR: checks: tcp-check actions are enums, not flags
In recent commit 5ecb77f
(MEDIUM: checks: add send/expect tcp based check),
bitfields were mistakenly used at some places for the actions. Fortunately,
the only two actions right now are 1 and 2 so they don't share any bit in
common and the bug has no impact.
No backport is needed.
This commit is contained in:
parent
3d536ac378
commit
98aec9ff47
|
@ -106,9 +106,9 @@ struct analyze_status {
|
||||||
unsigned char lr[HANA_OBS_SIZE]; /* result for l4/l7: 0 = ignore, 1 - error, 2 - OK */
|
unsigned char lr[HANA_OBS_SIZE]; /* result for l4/l7: 0 = ignore, 1 - error, 2 - OK */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* bits for tcpcheck_rule->action */
|
/* possible actions for tcpcheck_rule->action */
|
||||||
enum {
|
enum {
|
||||||
TCPCHK_ACT_SEND = 1, /* send action, regular string format */
|
TCPCHK_ACT_SEND = 0, /* send action, regular string format */
|
||||||
TCPCHK_ACT_EXPECT, /* expect action, either regular or binary string */
|
TCPCHK_ACT_EXPECT, /* expect action, either regular or binary string */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1998,7 +1998,7 @@ static void tcpcheck_main(struct connection *conn)
|
||||||
if (&cur->list == head)
|
if (&cur->list == head)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (check->current_step->action & TCPCHK_ACT_SEND) {
|
if (check->current_step->action == TCPCHK_ACT_SEND) {
|
||||||
/* reset the read buffer */
|
/* reset the read buffer */
|
||||||
if (*check->bi->data != '\0') {
|
if (*check->bi->data != '\0') {
|
||||||
*check->bi->data = '\0';
|
*check->bi->data = '\0';
|
||||||
|
@ -2029,7 +2029,7 @@ static void tcpcheck_main(struct connection *conn)
|
||||||
cur = (struct tcpcheck_rule *)cur->list.n;
|
cur = (struct tcpcheck_rule *)cur->list.n;
|
||||||
check->current_step = cur;
|
check->current_step = cur;
|
||||||
} /* end 'send' */
|
} /* end 'send' */
|
||||||
else if (check->current_step->action & TCPCHK_ACT_EXPECT) {
|
else if (check->current_step->action == TCPCHK_ACT_EXPECT) {
|
||||||
if (unlikely(check->result & SRV_CHK_FAILED))
|
if (unlikely(check->result & SRV_CHK_FAILED))
|
||||||
goto out_end_tcpcheck;
|
goto out_end_tcpcheck;
|
||||||
|
|
||||||
|
@ -2111,7 +2111,7 @@ static void tcpcheck_main(struct connection *conn)
|
||||||
else {
|
else {
|
||||||
cur = (struct tcpcheck_rule*)cur->list.n;
|
cur = (struct tcpcheck_rule*)cur->list.n;
|
||||||
check->current_step = cur;
|
check->current_step = cur;
|
||||||
if (check->current_step->action & TCPCHK_ACT_EXPECT)
|
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
||||||
goto tcpcheck_expect;
|
goto tcpcheck_expect;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_data_stop_recv(conn);
|
||||||
}
|
}
|
||||||
|
@ -2122,7 +2122,7 @@ static void tcpcheck_main(struct connection *conn)
|
||||||
if (cur->inverse) {
|
if (cur->inverse) {
|
||||||
cur = (struct tcpcheck_rule*)cur->list.n;
|
cur = (struct tcpcheck_rule*)cur->list.n;
|
||||||
check->current_step = cur;
|
check->current_step = cur;
|
||||||
if (check->current_step->action & TCPCHK_ACT_EXPECT)
|
if (check->current_step->action == TCPCHK_ACT_EXPECT)
|
||||||
goto tcpcheck_expect;
|
goto tcpcheck_expect;
|
||||||
__conn_data_stop_recv(conn);
|
__conn_data_stop_recv(conn);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue