Package: ulogd2-json
Version: 2.0.4-2
Severity: important
Tags: patch
Dear Maintainer,
* What led up to the situation ?
The display of most integer types is invalid on big endian systems.
* What exactly did you do (or not do) that was effective (or
ineffective)?
Using the plugin in a stack is enough.
* What was the outcome of this action?
Invalid values for integers like source port.
* What outcome did you expect instead?
Correct value of integer.
The bug is fixed in ulogd-2.0.5 but this fix should be backported to debian
stable.
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.17-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages ulogd2-json depends on:
ii libc6 2.19-18
ii libjansson4 2.7-1
ii multiarch-support 2.19-18
ii ulogd2 2.0.4-2
ulogd2-json recommends no packages.
ulogd2-json suggests no packages.
-- no debconf information
>From 4f267553aede76dc91133ba88c69f8b8faf00b72 Mon Sep 17 00:00:00 2001
From: Jimmy Jones <[email protected]>
Date: Sat, 26 Jul 2014 21:48:38 +0100
Subject: [PATCH] Fix JSON output on big endian systems
Signed-off-by: Jimmy Jones <[email protected]>
Signed-off-by: Eric Leblond <[email protected]>
---
output/ulogd_output_JSON.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/output/ulogd_output_JSON.c b/output/ulogd_output_JSON.c
index e7ac642..3ad2620 100644
--- a/output/ulogd_output_JSON.c
+++ b/output/ulogd_output_JSON.c
@@ -158,7 +158,11 @@ static int json_interp(struct ulogd_pluginstance *upi)
break;
case ULOGD_RET_BOOL:
case ULOGD_RET_INT8:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.i8));
+ break;
case ULOGD_RET_INT16:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.i16));
+ break;
case ULOGD_RET_INT32:
json_object_set_new(msg, field_name, json_integer(key->u.value.i32));
break;
@@ -171,10 +175,17 @@ static int json_interp(struct ulogd_pluginstance *upi)
json_object_set_new(msg, "action", json_string("blocked"));
break;
}
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui8));
+ break;
case ULOGD_RET_UINT16:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui16));
+ break;
case ULOGD_RET_UINT32:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui32));
+ break;
case ULOGD_RET_UINT64:
json_object_set_new(msg, field_name, json_integer(key->u.value.ui64));
+ break;
default:
/* don't know how to interpret this key. */
break;
--
2.1.4