0004-xtables-monitor-fix-build-with-musl-libc.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 90b0d3abfc0b4150b198eb17080d75acc5838a59 Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Sat, 17 Nov 2018 22:20:08 +0200
  4. Subject: [PATCH] xtables-monitor: fix build with musl libc
  5. Commit 7c8791edac3 ("xtables-monitor: fix build with older glibc")
  6. changed the code to use GNU style tcphdr fields. Unfortunately, musl
  7. libc requires _GNU_SOURCE definition to expose these fields.
  8. Fix the following build failure:
  9. xtables-monitor.c: In function ‘trace_print_packet’:
  10. xtables-monitor.c:406:43: error: ‘const struct tcphdr’ has no member named ‘source’
  11. printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest));
  12. ^~
  13. xtables-monitor.c:406:64: error: ‘const struct tcphdr’ has no member named ‘dest’
  14. printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest));
  15. ^~
  16. ...
  17. Cc: Florian Westphal <fw@strlen.de>
  18. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  19. Signed-off-by: Florian Westphal <fw@strlen.de>
  20. ---
  21. Upstream status: commit 90b0d3abfc0b
  22. iptables/xtables-monitor.c | 1 +
  23. 1 file changed, 1 insertion(+)
  24. diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
  25. index 5d1611122df5..f835c5e503e0 100644
  26. --- a/iptables/xtables-monitor.c
  27. +++ b/iptables/xtables-monitor.c
  28. @@ -9,6 +9,7 @@
  29. * This software has been sponsored by Sophos Astaro <http://www.sophos.com>
  30. */
  31. +#define _GNU_SOURCE
  32. #include <stdlib.h>
  33. #include <time.h>
  34. #include <string.h>
  35. --
  36. 2.19.1