You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.6 KiB

  1. From 4f267553aede76dc91133ba88c69f8b8faf00b72 Mon Sep 17 00:00:00 2001
  2. From: Jimmy Jones <jimmyjones2@gmx.co.uk>
  3. Date: Sat, 26 Jul 2014 21:48:38 +0100
  4. Subject: [PATCH] Fix JSON output on big endian systems
  5. Signed-off-by: Jimmy Jones <jimmyjones2@gmx.co.uk>
  6. ---
  7. output/ulogd_output_JSON.c | 11 +++++++++++
  8. 1 file changed, 11 insertions(+)
  9. diff --git a/output/ulogd_output_JSON.c b/output/ulogd_output_JSON.c
  10. index e7ac642..3ad2620 100644
  11. --- a/output/ulogd_output_JSON.c
  12. +++ b/output/ulogd_output_JSON.c
  13. @@ -158,7 +158,11 @@ static int json_interp(struct ulogd_pluginstance *upi)
  14. break;
  15. case ULOGD_RET_BOOL:
  16. case ULOGD_RET_INT8:
  17. + json_object_set_new(msg, field_name, json_integer(key->u.value.i8));
  18. + break;
  19. case ULOGD_RET_INT16:
  20. + json_object_set_new(msg, field_name, json_integer(key->u.value.i16));
  21. + break;
  22. case ULOGD_RET_INT32:
  23. json_object_set_new(msg, field_name, json_integer(key->u.value.i32));
  24. break;
  25. @@ -171,10 +175,17 @@ static int json_interp(struct ulogd_pluginstance *upi)
  26. json_object_set_new(msg, "action", json_string("blocked"));
  27. break;
  28. }
  29. + json_object_set_new(msg, field_name, json_integer(key->u.value.ui8));
  30. + break;
  31. case ULOGD_RET_UINT16:
  32. + json_object_set_new(msg, field_name, json_integer(key->u.value.ui16));
  33. + break;
  34. case ULOGD_RET_UINT32:
  35. + json_object_set_new(msg, field_name, json_integer(key->u.value.ui32));
  36. + break;
  37. case ULOGD_RET_UINT64:
  38. json_object_set_new(msg, field_name, json_integer(key->u.value.ui64));
  39. + break;
  40. default:
  41. /* don't know how to interpret this key. */
  42. break;
  43. --
  44. 2.3.0