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.

127 lines
3.1 KiB

  1. --- a/extensions/LUA/xt_LUA_target.c
  2. +++ b/extensions/LUA/xt_LUA_target.c
  3. @@ -19,7 +19,7 @@
  4. #include <linux/kernel.h>
  5. #include <linux/slab.h>
  6. #include <linux/module.h>
  7. -#include <asm/uaccess.h>
  8. +#include <linux/uaccess.h>
  9. #include <net/ip.h>
  10. #include <linux/netfilter/x_tables.h>
  11. #include "xt_LUA.h"
  12. @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY
  13. * XT_CONTINUE inside the *register_lua_packet_lib* function.
  14. */
  15. -spinlock_t lock = SPIN_LOCK_UNLOCKED;
  16. +DEFINE_SPINLOCK(lock);
  17. static uint32_t
  18. -lua_tg(struct sk_buff *pskb, const struct xt_target_param *par)
  19. +lua_tg(struct sk_buff *pskb, const struct xt_action_param *par)
  20. {
  21. uint32_t verdict;
  22. lua_packet_segment *p;
  23. @@ -88,11 +88,11 @@ lua_tg(struct sk_buff *pskb, const struc
  24. /* push the lua_packet_segment as a parameter */
  25. p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
  26. if (pskb->mac_header)
  27. - p->start = pskb->mac_header;
  28. + p->start = skb_mac_header(pskb);
  29. else if (pskb->network_header)
  30. - p->start = pskb->network_header;
  31. + p->start = skb_network_header(pskb);
  32. else if (pskb->transport_header)
  33. - p->start = pskb->transport_header;
  34. + p->start = skb_transport_header(pskb);
  35. p->offset = 0;
  36. p->length = (unsigned long)pskb->tail - (unsigned long)p->start;
  37. p->changes = NULL;
  38. @@ -208,16 +208,16 @@ static bool load_script_into_state(uint3
  39. * some workqueue initialization. So far this is done each time this function
  40. * is called, subject to change.
  41. */
  42. -static bool
  43. +static int
  44. lua_tg_checkentry(const struct xt_tgchk_param *par)
  45. {
  46. const struct xt_lua_tginfo *info = par->targinfo;
  47. if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) {
  48. lua_state_refs[info->state_id]++;
  49. - return true;
  50. + return 0;
  51. }
  52. - return false;
  53. + return -EINVAL;
  54. }
  55. /*::*
  56. --- a/extensions/LUA/lua/llimits.h
  57. +++ b/extensions/LUA/lua/llimits.h
  58. @@ -8,7 +8,6 @@
  59. #define llimits_h
  60. #include <stddef.h>
  61. -#include <limits.h>
  62. #include "lua.h"
  63. --- a/extensions/LUA/lua/lapi.c
  64. +++ b/extensions/LUA/lua/lapi.c
  65. @@ -4,9 +4,6 @@
  66. ** See Copyright Notice in lua.h
  67. */
  68. -#include <stdarg.h>
  69. -#include <math.h>
  70. -#include <assert.h>
  71. #include <string.h>
  72. #define lapi_c
  73. --- a/extensions/LUA/lua/ltable.c
  74. +++ b/extensions/LUA/lua/ltable.c
  75. @@ -18,7 +18,6 @@
  76. ** Hence even when the load factor reaches 100%, performance remains good.
  77. */
  78. -#include <math.h>
  79. #include <string.h>
  80. #define ltable_c
  81. --- a/extensions/LUA/lua/luaconf.h
  82. +++ b/extensions/LUA/lua/luaconf.h
  83. @@ -13,8 +13,12 @@
  84. #if !defined(__KERNEL__)
  85. #include <limits.h>
  86. #else
  87. +#include <linux/kernel.h>
  88. +
  89. +#undef UCHAR_MAX
  90. +#undef BUFSIZ
  91. +#undef NO_FPU
  92. #define UCHAR_MAX 255
  93. -#define SHRT_MAX 32767
  94. #define BUFSIZ 8192
  95. #define NO_FPU
  96. #endif
  97. @@ -637,6 +641,8 @@ union luai_Cast { double l_d; long l_l;
  98. */
  99. #if defined(__KERNEL__)
  100. #undef LUA_USE_ULONGJMP
  101. +#define setjmp __builtin_setjmp
  102. +#define longjmp __builtin_longjmp
  103. #endif
  104. #if defined(__cplusplus)
  105. --- a/extensions/LUA/lua/llex.h
  106. +++ b/extensions/LUA/lua/llex.h
  107. @@ -10,6 +10,8 @@
  108. #include "lobject.h"
  109. #include "lzio.h"
  110. +/* prevent conflict with definition from asm/current.h */
  111. +#undef current
  112. #define FIRST_RESERVED 257