Add Linux 6.2 Support
cover Add Linux 6.2 Support
The main purpose of the patch-set is to add support for 6.2, which removes prandom_u32_max, by replacing it with the function that supersedes it. We also introduce the LT_INIT into configure.ac.
Jeremy Sowden (3):
build: replace obsolete AC_PROG_LIBTOOL macro with LT_INIT
build: replace AC_DISABLE_STATIC macro with an argument to LT_INIT
build: support for Linux 6.2
configure.ac | 5 ++--- extensions/compat_xtables.h | 4 ++++ extensions/xt_TARPIT.c | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.39.0
PATCH 1/3 build: replace obsolete `AC_PROG_LIBTOOL` macro with `LT_INIT`
--- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
@@ -8,7 +8,7 @@ AC_PROG_CC AM_PROG_CC_C_O m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_DISABLE_STATIC -AC_PROG_LIBTOOL +LT_INIT AC_ARG_WITH([kbuild], AS_HELP_STRING([--with-kbuild=PATH],
Signature · 1 line
2.39.0
PATCH 2/3 build: replace `AC_DISABLE_STATIC` macro with an argument to `LT_INIT`
In reply to Jeremy Sowden--- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
configure.ac +1 -2
@@ -7,8 +7,7 @@ AM_INIT_AUTOMAKE([1.10b -Wall foreign subdir-objects]) AC_PROG_CC AM_PROG_CC_C_O m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AC_DISABLE_STATIC -LT_INIT +LT_INIT([disable-static]) AC_ARG_WITH([kbuild], AS_HELP_STRING([--with-kbuild=PATH],
Signature · 1 line
2.39.0
PATCH 3/3 build: support for Linux 6.2
In reply to Jeremy Sowdenprandom_u32_max was deprecated in favour of get_random_u32_below, and removed in 6.2-rc1. Replace the three occurrences of it in the TARPIT extension, and ad compat support for earlier kernels.
--- configure.ac | 2 +- extensions/compat_xtables.h | 4 ++++ extensions/xt_TARPIT.c | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-)
configure.ac +1 -1
@@ -58,7 +58,7 @@ AS_IF([test -n "$kbuilddir"], [ yoff ], [ echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir"; - if test "$kmajor" -gt 6 -o "$kmajor" -eq 6 -a "$kminor" -gt 1; then + if test "$kmajor" -gt 6 -o "$kmajor" -eq 6 -a "$kminor" -gt 2; then yon echo "WARNING: That kernel version is not officially supported yet. Continue at own luck."; yoff
extensions/compat_xtables.h +4 -0
@@ -48,4 +48,8 @@ static inline struct net *par_net(const struct xt_action_param *par)# define proc_release release#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (6 ,2 ,0 ) +# define get_random_u32_below prandom_u32_max +#endif +extern void *HX_memmem (const void *,size_t ,const void *,size_t );
extensions/xt_TARPIT.c +3 -3
@@ -107,8 +107,8 @@ static bool xttarpit_honeypot(struct tcphdr *tcph, const struct tcphdr *oth, tcph->syn = true; tcph->ack = true; tcph->window = oth->window & - (prandom_u32_max (0x20 ) -0xf ); - tcph->seq =htonl (prandom_u32_max (~oth->seq +1 )); + (get_random_u32_below (0x20 ) -0xf ); + tcph->seq =htonl (get_random_u32_below (~oth->seq +1 )); tcph->ack_seq =htonl (ntohl (oth->seq) + oth->syn); }
@@ -117,7 +117,7 @@ static bool xttarpit_honeypot(struct tcphdr *tcph, const struct tcphdr *oth, tcph->syn = false; tcph->ack = true; tcph->window = oth->window & - (prandom_u32_max (0x20 ) -0xf ); + (get_random_u32_below (0x20 ) -0xf ); tcph->ack_seq = payload >100 ?htonl (ntohl (oth->seq) + payload) : oth->seq;
Signature · 1 line
2.39.0
Quoted 3 lines · Jeremy Sowden
The main purpose of the patch-set is to add support for 6.2, which removes
prandom_u32_max, by replacing it with the function that supersedes it. We also introduce theLT_INITinto configure.ac.
added.