From: Adis Nezirovic Date: Wed, 26 Jul 2017 07:19:06 +0000 (+0200) Subject: BUG/MINOR: lua: Fix bitwise logic for hlua_server_check_* functions. X-Git-Tag: v1.8-dev3~202 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ceee9338625a81811e8475fdca74511f9ae2e654;p=thirdparty%2Fhaproxy.git BUG/MINOR: lua: Fix bitwise logic for hlua_server_check_* functions. The logical operations were inverted so enable/disable operations did the opposite. The bug is present since 1.7 so the fix should be backported there. --- diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index 6992613292..bc6bc914df 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -662,7 +662,7 @@ int hlua_server_check_enable(lua_State *L) sv = hlua_check_server(L, 1); if (sv->check.state & CHK_ST_CONFIGURED) { - sv->check.state &= ~CHK_ST_ENABLED; + sv->check.state |= CHK_ST_ENABLED; } return 0; } @@ -673,7 +673,7 @@ int hlua_server_check_disable(lua_State *L) sv = hlua_check_server(L, 1); if (sv->check.state & CHK_ST_CONFIGURED) { - sv->check.state |= CHK_ST_ENABLED; + sv->check.state &= ~CHK_ST_ENABLED; } return 0; }