1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00
openmptcprouter-feeds/fullconenat/patches/001-linux-6.1-support.patch
Ycarus (Yannick Chabanois) b069e56633 Add fullconenat
2022-12-21 12:50:49 +01:00

26 lines
874 B
Diff

--- a/xt_FULLCONENAT.c
+++ b/xt_FULLCONENAT.c
@@ -325,7 +325,11 @@
/* for now we do the same thing for both --random and --random-fully */
/* select a random starting point */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+ start = (uint16_t)(get_random_u32() % (u32)range_size);
+#else
start = (uint16_t)(prandom_u32() % (u32)range_size);
+#endif
} else {
if ((original_port >= min && original_port <= min + range_size - 1)
@@ -995,7 +999,11 @@
/* for now we do the same thing for both --random and --random-fully */
/* select a random starting point */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+ start = (uint16_t)(get_random_u32() % (u32)range_size);
+#else
start = (uint16_t)(prandom_u32() % (u32)range_size);
+#endif
} else {
if ((original_port >= min && original_port <= min + range_size - 1)