201-fix-lua-packetscript.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --- a/extensions/LUA/xt_LUA_target.c
  2. +++ b/extensions/LUA/xt_LUA_target.c
  3. @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY
  4. * XT_CONTINUE inside the *register_lua_packet_lib* function.
  5. */
  6. -spinlock_t lock = SPIN_LOCK_UNLOCKED;
  7. +DEFINE_SPINLOCK(lock);
  8. static uint32_t
  9. -lua_tg(struct sk_buff *pskb, const struct xt_target_param *par)
  10. +lua_tg(struct sk_buff *pskb, const struct xt_action_param *par)
  11. {
  12. uint32_t verdict;
  13. lua_packet_segment *p;
  14. @@ -208,16 +208,16 @@ static bool load_script_into_state(uint3
  15. * some workqueue initialization. So far this is done each time this function
  16. * is called, subject to change.
  17. */
  18. -static bool
  19. +static int
  20. lua_tg_checkentry(const struct xt_tgchk_param *par)
  21. {
  22. const struct xt_lua_tginfo *info = par->targinfo;
  23. if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) {
  24. lua_state_refs[info->state_id]++;
  25. - return true;
  26. + return 0;
  27. }
  28. - return false;
  29. + return -EINVAL;
  30. }
  31. /*::*
  32. --- a/extensions/LUA/lua/llimits.h
  33. +++ b/extensions/LUA/lua/llimits.h
  34. @@ -8,7 +8,6 @@
  35. #define llimits_h
  36. #include <stddef.h>
  37. -#include <limits.h>
  38. #include "lua.h"
  39. --- a/extensions/LUA/lua/lapi.c
  40. +++ b/extensions/LUA/lua/lapi.c
  41. @@ -4,9 +4,6 @@
  42. ** See Copyright Notice in lua.h
  43. */
  44. -#include <stdarg.h>
  45. -#include <math.h>
  46. -#include <assert.h>
  47. #include <string.h>
  48. #define lapi_c
  49. --- a/extensions/LUA/lua/ltable.c
  50. +++ b/extensions/LUA/lua/ltable.c
  51. @@ -18,7 +18,6 @@
  52. ** Hence even when the load factor reaches 100%, performance remains good.
  53. */
  54. -#include <math.h>
  55. #include <string.h>
  56. #define ltable_c
  57. --- a/extensions/LUA/lua/luaconf.h
  58. +++ b/extensions/LUA/lua/luaconf.h
  59. @@ -13,6 +13,10 @@
  60. #if !defined(__KERNEL__)
  61. #include <limits.h>
  62. #else
  63. +#undef UCHAR_MAX
  64. +#undef SHRT_MAX
  65. +#undef BUFSIZ
  66. +#undef NO_FPU
  67. #define UCHAR_MAX 255
  68. #define SHRT_MAX 32767
  69. #define BUFSIZ 8192
  70. @@ -637,6 +641,8 @@ union luai_Cast { double l_d; long l_l;
  71. */
  72. #if defined(__KERNEL__)
  73. #undef LUA_USE_ULONGJMP
  74. +#define setjmp __builtin_setjmp
  75. +#define longjmp __builtin_longjmp
  76. #endif
  77. #if defined(__cplusplus)