Skip to contentSkip to conversation

: promote netfilter MARK values to sit packets

PATCH New Erik Hensema 1 participant 1 message Feb 18, 2003

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

PATCH 1/1 : promote netfilter MARK values to sit packets

This is the patch I sent to the list yesterday, this time including config options and help. The code should apply to at least 2.4.19 and up, the Configure.help patch is made against 2.4.21-pre4.

Is this material for lkml and/or Marcello yet?

Signature · 1 line
Erik Hensema ([email protected])
Documentation/Configure.help +12 -0
diff -ur linux-2.4.21-pre4/Documentation/Configure.help linux-2.4.21-pre4.patched/Documentation/Configure.help
@@ -5627,6 +5627,18 @@
 
   It is safe to say N here for now.
 
+IPv6: Promote netfilter MARK value to sit packets
+CONFIG_IPV6_SIT_PROMOTE_MARK
+  If you use IPv6-in-IPv4 tunnels, you can use this option to mark
+  packets using ip6tables, and then match the sit (tunnel) packets
+  using iptables on the IPv4 level, or a tc fw match on the physical
+  outgoing interface.
+
+  You need this if you want to provide QoS on a tunnelled IPv6
+  connection.
+
+  If unsure, say N.
+
 Kernel httpd acceleration
 CONFIG_KHTTPD
   The kernel httpd acceleration daemon (kHTTPd) is a (limited) web
net/ipv6/Config.in +4 -0
diff -ur linux-2.4.21-pre4/net/ipv6/Config.in linux-2.4.21-pre4.patched/net/ipv6/Config.in
@@ -7,4 +7,8 @@
 
 if [ "$CONFIG_NETFILTER" != "n" ]; then
    source net/ipv6/netfilter/Config.in
+
+   if [ "$CONFIG_IP6_NF_IPTABLES" != "n" ] ; then
+      bool '  IPv6: Promote netfilter MARK value to sit packets' CONFIG_IPV6_SIT_PROMOTE_MARK
+   fi
 fi
net/ipv6/sit.c +3 -0
diff -ur linux-2.4.21-pre4/net/ipv6/sit.c linux-2.4.21-pre4.patched/net/ipv6/sit.c
@@ -571,6 +571,9 @@
 		}
 		if (skb->sk)
 			skb_set_owner_w(new_skb, skb->sk);
+#ifdef CONFIG_IPV6_SIT_PROMOTE_MARK
+		new_skb->nfmark = skb->nfmark;
+#endif
 		dev_kfree_skb(skb);
 		skb = new_skb;
 	}