0004-mausezahn-move-variable-definitions-from-mops-h-to-mops-c.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 3178ceb8c7e0a94ed29bbd1e277f03bb0d5a3d44 Mon Sep 17 00:00:00 2001
  2. From: Tobias Klauser <tklauser@distanz.ch>
  3. Date: Wed, 19 Aug 2020 12:58:51 +0200
  4. Subject: [PATCH] mausezahn: move variable definitions from mops.h to mops.c
  5. Move variable definitions to avoid "multiple definition of symbol"
  6. linker errors with gcc-10.
  7. Updates #216
  8. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
  9. [Retrieved from:
  10. https://github.com/netsniff-ng/netsniff-ng/commit/3178ceb8c7e0a94ed29bbd1e277f03bb0d5a3d44]
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. ---
  13. staging/mops.c | 5 ++++-
  14. staging/mops.h | 8 ++++----
  15. 2 files changed, 8 insertions(+), 5 deletions(-)
  16. diff --git a/staging/mops.c b/staging/mops.c
  17. index 599d317f..fc00e29a 100644
  18. --- a/staging/mops.c
  19. +++ b/staging/mops.c
  20. @@ -46,8 +46,11 @@
  21. #include "mz.h"
  22. #include "mops.h"
  23. +unsigned int min_frame_s;
  24. +unsigned int max_frame_s;
  25. -
  26. +struct automops * amp_head;
  27. +struct mops *mp_head; // This global will point to the head of the mops list
  28. // Creates first element, aka "head" element
  29. // This element can also be used! See mops_alloc_packet!
  30. diff --git a/staging/mops.h b/staging/mops.h
  31. index 96953e66..cf19f098 100644
  32. --- a/staging/mops.h
  33. +++ b/staging/mops.h
  34. @@ -114,8 +114,8 @@
  35. // These are initialized with the definitions MIN_MOPS_FRAME_SIZE and
  36. // MAX_MOPS_FRAME_SIZE above but can be overridden by the user (without
  37. // extending these limits)
  38. -unsigned int min_frame_s;
  39. -unsigned int max_frame_s;
  40. +extern unsigned int min_frame_s;
  41. +extern unsigned int max_frame_s;
  42. struct mops_counter
  43. {
  44. @@ -246,7 +246,7 @@ struct automops {
  45. };
  46. -struct automops * amp_head;
  47. +extern struct automops * amp_head;
  48. struct mops
  49. @@ -688,7 +688,7 @@ struct mops_ext_syslog //TODO
  50. /////////////////////////////////////////////////////////////////
  51. -struct mops *mp_head; // This global will point to the head of the mops list
  52. +extern struct mops *mp_head; // This global will point to the head of the mops list
  53. /////////////////////////////////////////////////////////////////
  54. // MOPS Prototypes: