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.

110 lines
2.7 KiB

  1. From 27a54379cf3c48ff63c02a4a9f023297bba60d45 Mon Sep 17 00:00:00 2001
  2. From: Noel Kuntze <noel.kuntze@thermi.consulting>
  3. Date: Mon, 12 Jul 2021 01:29:43 +0200
  4. Subject: [PATCH 900/904] src: Patch for building with musl on openwrt (taken
  5. verbatim from openwrt package sources)
  6. ---
  7. .../kernel_netlink/kernel_netlink_ipsec.c | 1 +
  8. .../kernel_netlink/kernel_netlink_net.c | 2 +
  9. .../kernel_netlink/kernel_netlink_shared.c | 2 +
  10. src/libstrongswan/library.h | 1 +
  11. src/libstrongswan/musl.h | 38 +++++++++++++++++++
  12. .../plugins/bliss/bliss_huffman.c | 2 +
  13. 6 files changed, 46 insertions(+)
  14. create mode 100644 src/libstrongswan/musl.h
  15. --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
  16. +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
  17. @@ -40,6 +40,7 @@
  18. */
  19. #define _GNU_SOURCE
  20. +#include <musl.h>
  21. #include <sys/types.h>
  22. #include <sys/socket.h>
  23. #include <sys/ioctl.h>
  24. --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
  25. +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
  26. @@ -37,6 +37,8 @@
  27. * THE SOFTWARE.
  28. */
  29. +#include "musl.h"
  30. +
  31. #include <sys/socket.h>
  32. #include <sys/utsname.h>
  33. #include <linux/netlink.h>
  34. --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c
  35. +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c
  36. @@ -39,6 +39,8 @@
  37. * THE SOFTWARE.
  38. */
  39. +#include "musl.h"
  40. +
  41. #include <sys/socket.h>
  42. #include <linux/netlink.h>
  43. #include <linux/rtnetlink.h>
  44. --- a/src/libstrongswan/library.h
  45. +++ b/src/libstrongswan/library.h
  46. @@ -119,6 +119,7 @@
  47. #include "utils/leak_detective.h"
  48. #include "plugins/plugin_loader.h"
  49. #include "settings/settings.h"
  50. +#include "musl.h"
  51. typedef struct library_t library_t;
  52. --- /dev/null
  53. +++ b/src/libstrongswan/musl.h
  54. @@ -0,0 +1,38 @@
  55. +#include <sys/types.h>
  56. +
  57. +#define crypt x_crypt
  58. +#define encrypt x_encrypt
  59. +#include <unistd.h>
  60. +
  61. +#define fd_set x_fd_set
  62. +#define ino_t x_ino_t
  63. +#define off_t x_off_t
  64. +#define loff_t x_loff_t
  65. +#define dev_t x_dev_t
  66. +#define mode_t x_mode_t
  67. +#define uid_t x_uid_t
  68. +#define gid_t x_gid_t
  69. +#define uint64_t x_uint64_t
  70. +#define u_int64_t x_u_int64_t
  71. +#define int64_t x_int64_t
  72. +#define nlink_t x_nlink_t
  73. +#define timer_t x_timer_t
  74. +#define blkcnt_t x_blkcnt_t
  75. +
  76. +#include <linux/types.h>
  77. +
  78. +#undef fd_set
  79. +#undef ino_t
  80. +#undef off_t
  81. +#undef dev_t
  82. +#undef mode_t
  83. +#undef uid_t
  84. +#undef gid_t
  85. +#undef uint64_t
  86. +#undef u_int64_t
  87. +#undef int64_t
  88. +#undef nlink_t
  89. +#undef timer_t
  90. +#undef blkcnt_t
  91. +#undef crypt
  92. +#undef encrypt
  93. --- a/src/libstrongswan/plugins/bliss/bliss_huffman.c
  94. +++ b/src/libstrongswan/plugins/bliss/bliss_huffman.c
  95. @@ -17,6 +17,8 @@
  96. #include "bliss_param_set.h"
  97. #include <library.h>
  98. +#undef fprintf
  99. +#undef printf
  100. #include <stdio.h>
  101. #include <math.h>