From ff07415a3b827737a6be30d3d36ef123363556e1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 27 Mar 2021 20:10:03 +0000 Subject: [PATCH] [Minor] Ratelimit: Fix formatting issue --- src/lua/lua_mempool.c | 6 ++++-- src/plugins/lua/reputation.lua | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lua/lua_mempool.c b/src/lua/lua_mempool.c index 396f39170..5f1fe46b3 100644 --- a/src/lua/lua_mempool.c +++ b/src/lua/lua_mempool.c @@ -524,8 +524,10 @@ lua_mempool_get_variable (lua_State *L) return nvar; } - - lua_pushstring (L, value); + else { + /* No type specified, return string */ + lua_pushstring(L, value); + } } else { lua_pushnil (L); diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index 5ee16354b..d846ece9a 100644 --- a/src/plugins/lua/reputation.lua +++ b/src/plugins/lua/reputation.lua @@ -411,19 +411,22 @@ local function ip_reputation_filter(task, rule) if asn_stats then local asn_score = generic_reputation_calc(asn_stats, rule, cfg.scores.asn, task) score = score + asn_score - table.insert(description_t, string.format('asn: %s(%.2f)', asn, asn_score)) + table.insert(description_t, string.format('asn: %s(%.2f)', + asn, asn_score)) end if country_stats then local country_score = generic_reputation_calc(country_stats, rule, cfg.scores.country, task) score = score + country_score - table.insert(description_t, string.format('country: %s(%.2f)', country, country_score)) + table.insert(description_t, string.format('country: %s(%.2f)', + country, country_score)) end if ip_stats then local ip_score = generic_reputation_calc(ip_stats, rule, cfg.scores.ip, task) score = score + ip_score - table.insert(description_t, string.format('ip: %s(%.2f)', ip, ip_score)) + table.insert(description_t, string.format('ip: %s(%.2f)', + tostring(ip), ip_score)) end if math.abs(score) > 0.001 then -- 2.39.5