diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-18 12:58:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-18 12:58:57 +0000 |
commit | 0f32df6f44c75cb9be69618e699fb2972cc7d421 (patch) | |
tree | c7be839a23808ac274a0fc5c14c75a55607600ad /src/lua/lua_upstream.c | |
parent | c9d04a923e2a64321df8128aa4efaacdfccbed2f (diff) | |
download | rspamd-0f32df6f44c75cb9be69618e699fb2972cc7d421.tar.gz rspamd-0f32df6f44c75cb9be69618e699fb2972cc7d421.zip |
[Fix] Core: Fix address rotation bug
Previously, upstream.get_addr function returned the new address of the
upstream. Unfortunately, it was used for printing addresses. It caused
the following situation: let's imagine we have A1 and A2 where A1 was
initially selected. So the connection was performed to A1:
Current addr Selected addr
Connect+---------+ A2+------>A1 A1
|
+-+Print failure<---+ A1+------>A2 A2
| +----+
+->Mark failure+-------->+ A2 |
+----+
But the failure OP as well as log message told about `A2` where the real
problem happened with `A1`.
This commit adds distinguishing between getting the next and the current
address of the upstream resolving this issue.
Diffstat (limited to 'src/lua/lua_upstream.c')
-rw-r--r-- | src/lua/lua_upstream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lua/lua_upstream.c b/src/lua/lua_upstream.c index 1a4d6b128..37c541d9d 100644 --- a/src/lua/lua_upstream.c +++ b/src/lua/lua_upstream.c @@ -110,7 +110,7 @@ lua_upstream_get_addr (lua_State *L) struct upstream *up = lua_check_upstream (L); if (up) { - rspamd_lua_ip_push (L, rspamd_upstream_addr (up)); + rspamd_lua_ip_push (L, rspamd_upstream_addr_next (up)); } else { lua_pushnil (L); |