`prandom_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.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
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
# 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);
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);
}
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;