]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] P0f: More output fixes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Nov 2019 13:11:22 +0000 (13:11 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Nov 2019 13:11:22 +0000 (13:11 +0000)
lualib/lua_scanners/p0f.lua

index 0e7bd42795b88fe59ded73be0fb543cfa5d19746..06953660d234f92880a14603a8735e5027cd1ef2 100644 (file)
@@ -100,11 +100,17 @@ local function p0f_check(task, ip, rule)
       uptime_min, distance)
 
     if link_type and #link_type > 0 then
-      common.yield_result(task, rule, string.format('%s, link=%s, distance: %s',
-          os_string, link_type, distance), 0.0)
+      common.yield_result(task, rule, {
+        os_string,
+        'link=' .. link_type,
+        'distance=' .. distance},
+          0.0)
     else
-      common.yield_result(task, rule, string.format('%s, distance: %s',
-          os_string, distance), 0.0)
+      common.yield_result(task, rule, {
+        os_string,
+        'link=unknown',
+        'distance=' .. distance},
+          0.0)
     end
 
     return data
@@ -122,6 +128,8 @@ local function p0f_check(task, ip, rule)
 
       if err then
         rspamd_logger.errx(task, 'p0f received an error: %s', err)
+        common.yield_result(task, rule, 'Error getting result: ' .. err,
+            0.0, 'fail')
         return
       end