Skip to contentSkip to conversation

IPv6 stateful macht support for 2.6.15.2

PATCH Gregor Maier 2 participants 2 messages Feb 6, 2006 – Feb 7, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

since I haven't found state match support for IPv6 in the kernel (although it's supported by iptables 1.3.5) if ported the ipt_state.c code to v6 (ip6t_state.c).

So here's a patch that adds IPv6 state match support to the kernel.

cu
Gregor

Signature · 3 lines
Gregor Maier                                      Lehrstuhl Informatik 8
[email protected]                              Tel: +49 89  289-18010
http://www.net.in.tum.de                                     TU Muenchen
include/linux/netfilter_ipv6/ip6t_state.h +13 -0
diff -Naur linux-2.6.15.2.orig/include/linux/netfilter_ipv6/ip6t_state.h linux-2.6.15.2/include/linux/netfilter_ipv6/ip6t_state.h
@@ -0,0 +1,13 @@
+#ifndef _IP6T_STATE_H
+#define _IP6T_STATE_H
+
+#define IP6T_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define IP6T_STATE_INVALID (1 << 0)
+
+#define IP6T_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
+
+struct ip6t_state_info
+{
+	unsigned int statemask;
+};
+#endif /*_IP6T_STATE_H*/
net/ipv6/netfilter/ip6t_state.c +77 -0

77 lines not on this page · raw message

net/ipv6/netfilter/Kconfig +11 -0
diff -Naur linux-2.6.15.2.orig/net/ipv6/netfilter/Kconfig linux-2.6.15.2/net/ipv6/netfilter/Kconfig
@@ -115,6 +115,17 @@
 
 	  To compile it as a module, choose M here.  If unsure, say N.
 
+config IP6_NF_MATCH_STATE
+	tristate "Connection state match support"
+	depends on IP6_NF_IPTABLES
+	depends on NF_CONNTRACK_IPV6
+	help
+	  Connection state matching allows you to match packets based on their
+	  relationship to a tracked connection (ie. previous packets).  This
+	  is a powerful tool for packet classification.
+
+	  To compile it as a module, choose M here.  If unsure, say N.
+
 config IP6_NF_MATCH_OWNER
 	tristate "Owner match support"
 	depends on IP6_NF_IPTABLES
net/ipv6/netfilter/Makefile +3 -0
diff -Naur linux-2.6.15.2.orig/net/ipv6/netfilter/Makefile linux-2.6.15.2/net/ipv6/netfilter/Makefile
@@ -33,3 +33,6 @@
 
 # l3 independent conntrack
 obj-$(CONFIG_NF_CONNTRACK_IPV6) += nf_conntrack_ipv6.o
+
+obj-$(CONFIG_IP6_NF_MATCH_STATE) += ip6t_state.o
+
#1 lore raw
Quoted 7 lines · Gregor Maier

Hi,

since I haven't found state match support for IPv6 in the kernel (although it's supported by iptables 1.3.5) if ported the ipt_state.c code to v6 (ip6t_state.c).

So here's a patch that adds IPv6 state match support to the kernel.

2.6.16-rc2 includes an IPv6 state match.