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.

69 lines
2.2 KiB

  1. Restore support for kernel 4.14
  2. This reverts commit bf63a25a64c9223435c26e6543ba749834b47752.
  3. ---
  4. configure.ac | 2 +-
  5. extensions/compat_xtables.h | 4 ++--
  6. extensions/pknock/xt_pknock.c | 16 ++++++++++++++++
  7. 3 files changed, 19 insertions(+), 3 deletions(-)
  8. --- a/configure.ac
  9. +++ b/configure.ac
  10. @@ -61,7 +61,7 @@ if test -n "$kbuilddir"; then
  11. echo "WARNING: That kernel version is not officially supported yet. Continue at own luck.";
  12. elif test "$kmajor" -eq 5 -a "$kminor" -ge 0; then
  13. :
  14. - elif test "$kmajor" -eq 4 -a "$kminor" -ge 15; then
  15. + elif test "$kmajor" -eq 4 -a "$kminor" -ge 14; then
  16. :
  17. else
  18. echo "WARNING: That kernel version is not officially supported.";
  19. --- a/extensions/compat_xtables.h
  20. +++ b/extensions/compat_xtables.h
  21. @@ -8,8 +8,8 @@
  22. #define DEBUGP Use__pr_debug__instead
  23. -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
  24. -# warning Kernels below 4.15 not supported.
  25. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
  26. +# warning Kernels below 4.14 not supported.
  27. #endif
  28. #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
  29. --- a/extensions/pknock/xt_pknock.c
  30. +++ b/extensions/pknock/xt_pknock.c
  31. @@ -356,10 +356,18 @@ has_logged_during_this_minute(const stru
  32. *
  33. * @r: rule
  34. */
  35. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  36. static void peer_gc(struct timer_list *tl)
  37. +#else
  38. +static void peer_gc(unsigned long r)
  39. +#endif
  40. {
  41. unsigned int i;
  42. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  43. struct xt_pknock_rule *rule = from_timer(rule, tl, timer);
  44. +#else
  45. + struct xt_pknock_rule *rule = (struct xt_pknock_rule *)r;
  46. +#endif
  47. struct peer *peer;
  48. struct list_head *pos, *n;
  49. @@ -466,7 +474,15 @@ add_rule(struct xt_pknock_mtinfo *info)
  50. rule->peer_head = alloc_hashtable(peer_hashsize);
  51. if (rule->peer_head == NULL)
  52. goto out;
  53. +
  54. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  55. timer_setup(&rule->timer, peer_gc, 0);
  56. +#else
  57. + init_timer(&rule->timer);
  58. + rule->timer.function = peer_gc;
  59. + rule->timer.data = (unsigned long)rule;
  60. +#endif
  61. +
  62. rule->status_proc = proc_create_data(info->rule_name, 0, pde,
  63. &pknock_proc_ops, rule);
  64. if (rule->status_proc == NULL)