Skip to contentSkip to conversation

random match ported to 2.6

PATCH New SiegeX 1 participant 1 message Nov 21, 2004 netfilter

lore
Share & tools
lore

SiegeX

author
#0 lore raw

PATCH 1/1 random match ported to 2.6

Quoted 1 line

From looking over past posts dealing with patches, seems that I didnt follow the correct way of doing things with my earlier post so this is to make things easier for you guys.

This was patched agasint the latest STABLE PoM-ng. Note that although this patch looks pretty big, the only file that needed altering was ipt_random.c. The rest of the patch is just building the linux-2.6 tree.

info 2004-11-18 10:32:02.000000000 -0800 renamed from info 2004-02-19 15:49:32.000000000 -0800 +0 -1
diff -uNr random-orig/info random/info
@@ -1,4 +1,3 @@
 Author: Fabrice MARIE <[email protected]>
 Status: Works For Me.
 Repository: base
-Requires: linux < 2.6.0
linux-2.6/include/linux/netfilter_ipv4/ipt_random.h 2003-12-18 10:28:45.000000000 -0800 renamed from linux-2.6/include/linux/netfilter_ipv4/ipt_random.h 1969-12-31 16:00:00.000000000 -0800 +11 -0
diff -uNr random-orig/linux-2.6/include/linux/netfilter_ipv4/ipt_random.h random/linux-2.6/include/linux/netfilter_ipv4/ipt_random.h
@@ -0,0 +1,11 @@
+#ifndef _IPT_RAND_H
+#define _IPT_RAND_H
+
+#include <linux/param.h>
+#include <linux/types.h>
+
+struct ipt_rand_info {
+  u_int8_t average;
+};
+
+#endif /*_IPT_RAND_H*/
linux-2.6/include/linux/netfilter_ipv6/ip6t_random.h 2003-12-20 08:36:09.000000000 -0800 renamed from linux-2.6/include/linux/netfilter_ipv6/ip6t_random.h 1969-12-31 16:00:00.000000000 -0800 +11 -0
diff -uNr random-orig/linux-2.6/include/linux/netfilter_ipv6/ip6t_random.h random/linux-2.6/include/linux/netfilter_ipv6/ip6t_random.h
@@ -0,0 +1,11 @@
+#ifndef _IP6T_RAND_H
+#define _IP6T_RAND_H
+
+#include <linux/param.h>
+#include <linux/types.h>
+
+struct ip6t_rand_info {
+  u_int8_t average;
+};
+
+#endif /*_IP6T_RAND_H*/
linux-2.6/net/ipv4/netfilter/Kconfig.ladd 2004-05-06 06:37:39.000000000 -0700 renamed from linux-2.6/net/ipv4/netfilter/Kconfig.ladd 1969-12-31 16:00:00.000000000 -0800 +10 -0
diff -uNr random-orig/linux-2.6/net/ipv4/netfilter/Kconfig.ladd random/linux-2.6/net/ipv4/netfilter/Kconfig.ladd
@@ -0,0 +1,10 @@
+config IP_NF_MATCH_RANDOM
+  tristate  'random match support'
+  depends on IP_NF_IPTABLES
+  help
+    This option adds a `random' match,
+    which allow you to match packets randomly
+    following a given probability.
+
+    If you want to compile it as a module, say M here and read
+    Documentation/modules.txt.  If unsure, say `N'.
linux-2.6/net/ipv4/netfilter/Makefile.ladd 2003-12-18 10:28:45.000000000 -0800 renamed from linux-2.6/net/ipv4/netfilter/Makefile.ladd 1969-12-31 16:00:00.000000000 -0800 +3 -0
diff -uNr random-orig/linux-2.6/net/ipv4/netfilter/Makefile.ladd random/linux-2.6/net/ipv4/netfilter/Makefile.ladd
@@ -0,0 +1,3 @@
+obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
+
+obj-$(CONFIG_IP_NF_MATCH_RANDOM) += ipt_random.o
linux-2.6/net/ipv4/netfilter/ipt_random.c 2004-11-18 10:39:22.000000000 -0800 renamed from linux-2.6/net/ipv4/netfilter/ipt_random.c 1969-12-31 16:00:00.000000000 -0800 +92 -0

92 lines not on this page · raw message

linux-2.6/net/ipv6/netfilter/Kconfig.ladd 2004-05-06 06:37:39.000000000 -0700 renamed from linux-2.6/net/ipv6/netfilter/Kconfig.ladd 1969-12-31 16:00:00.000000000 -0800 +10 -0
diff -uNr random-orig/linux-2.6/net/ipv6/netfilter/Kconfig.ladd random/linux-2.6/net/ipv6/netfilter/Kconfig.ladd
@@ -0,0 +1,10 @@
+config IP6_NF_MATCH_RANDOM
+  tristate  'Random match support'
+  depends on IP6_NF_IPTABLES
+  help
+    This option adds a `random' match,
+    which allow you to match packets randomly
+    following a given probability.
+
+    If you want to compile it as a module, say M here and read
+    Documentation/modules.txt.  If unsure, say `N'.
linux-2.6/net/ipv6/netfilter/Makefile.ladd 2003-12-20 08:36:09.000000000 -0800 renamed from linux-2.6/net/ipv6/netfilter/Makefile.ladd 1969-12-31 16:00:00.000000000 -0800 +3 -0
diff -uNr random-orig/linux-2.6/net/ipv6/netfilter/Makefile.ladd random/linux-2.6/net/ipv6/netfilter/Makefile.ladd
@@ -0,0 +1,3 @@
+obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
+
+obj-$(CONFIG_IP6_NF_MATCH_RANDOM) += ip6t_random.o
linux-2.6/net/ipv6/netfilter/ip6t_random.c 2003-12-20 08:36:09.000000000 -0800 renamed from linux-2.6/net/ipv6/netfilter/ip6t_random.c 1969-12-31 16:00:00.000000000 -0800 +97 -0

97 lines not on this page · raw message