mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			874 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			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)
 |