0001-utils-nfsynproxy-fix-build-with-musl-libc.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 06e0312d0bfd1f0b9e7c23ab654f18524d49e86b Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Thu, 2 Mar 2017 09:20:48 +0200
  4. Subject: [PATCH] utils: nfsynproxy: fix build with musl libc
  5. The musl libc exposes some struct tcphdr field only when _GNU_SOURCE is
  6. defined. Fix the following build failure:
  7. nfsynproxy.c: In function ‘parse_packet’:
  8. nfsynproxy.c:34:9: error: ‘const struct tcphdr’ has no member named ‘syn’
  9. if (!th->syn || !th->ack)
  10. ^
  11. nfsynproxy.c:34:21: error: ‘const struct tcphdr’ has no member named ‘ack’
  12. if (!th->syn || !th->ack)
  13. ^
  14. nfsynproxy.c:42:8: error: ‘const struct tcphdr’ has no member named ‘res2’
  15. if (th->res2 == 0x1)
  16. ^
  17. nfsynproxy.c:45:13: error: ‘const struct tcphdr’ has no member named ‘doff’
  18. length = th->doff * 4 - sizeof(*th);
  19. ^
  20. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  21. ---
  22. Upstream status: pending (http://patchwork.ozlabs.org/patch/734503/)
  23. utils/nfsynproxy.c | 1 +
  24. 1 file changed, 1 insertion(+)
  25. diff --git a/utils/nfsynproxy.c b/utils/nfsynproxy.c
  26. index baedc92c5d9f..bf5c416340f1 100644
  27. --- a/utils/nfsynproxy.c
  28. +++ b/utils/nfsynproxy.c
  29. @@ -6,6 +6,7 @@
  30. * published by the Free Software Foundation.
  31. */
  32. +#define _GNU_SOURCE
  33. #include <stdlib.h>
  34. #include <stdbool.h>
  35. #include <unistd.h>
  36. --
  37. 2.11.0