BUG/MINOR: stconn: Always declare the SC created from healthchecks as a back SC

The SC created from a healthcheck is always a back SC. But SC_FL_ISBACK
flags was missing. Instead of passing it when sc_new_from_check() is called,
the function was simplified to set SC_FL_ISBACK flag systematically when a
SC is created from a healthcheck.

This patch should be backported as far as 2.6.
This commit is contained in:
Christopher Faulet 2026-03-30 15:24:52 +02:00
parent d4eee1f206
commit 5280130343
3 changed files with 4 additions and 4 deletions

View file

@ -45,7 +45,7 @@ void se_shutdown(struct sedesc *sedesc, enum se_shut_mode mode);
struct stconn *sc_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input);
struct stconn *sc_new_from_strm(struct stream *strm, unsigned int flags);
struct stconn *sc_new_from_check(struct check *check, unsigned int flags);
struct stconn *sc_new_from_check(struct check *check);
void sc_free(struct stconn *sc);
int sc_attach_mux(struct stconn *sc, void *target, void *ctx);

View file

@ -1317,7 +1317,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
check->current_step = NULL;
check->sc = sc_new_from_check(check, SC_FL_NONE);
check->sc = sc_new_from_check(check);
if (!check->sc) {
set_server_check_status(check, HCHK_STATUS_SOCKERR, NULL);
goto end;

View file

@ -219,14 +219,14 @@ struct stconn *sc_new_from_strm(struct stream *strm, unsigned int flags)
* thus it will be created by sc_new(). So the SE_FL_DETACHED flag is set. It
* returns NULL on error. On success, the new stream connector is returned.
*/
struct stconn *sc_new_from_check(struct check *check, unsigned int flags)
struct stconn *sc_new_from_check(struct check *check)
{
struct stconn *sc;
sc = sc_new(NULL);
if (unlikely(!sc))
return NULL;
sc->flags |= flags;
sc->flags = SC_FL_ISBACK;
sc_ep_set(sc, SE_FL_DETACHED);
sc->app = &check->obj_type;
return sc;