Skip to contentSkip to conversation

: Relax hook check in ipt_CLASSIFY

PATCH In review Harald Welte 1 participant 1 message Jun 21, 2004

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

PATCH 10/14 : Relax hook check in ipt_CLASSIFY

This patch for 2.6 removes the unneccessary restriction to POST_ROUTING from ipt_CLASSIFY. In 2.6, skb->priority is set before any of LOCAL_OUT, FORWARD and POST_ROUTING are hit, so we can remove this restriction.

Author: Patrick McHardy <[email protected]>

--
- Harald Welte <[email protected]> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/06/20 22:46:05+02:00 [email protected]
# [NETFILTER]: Relax hook check in ipt_CLASSIFY
#
# net/ipv4/netfilter/ipt_CLASSIFY.c
# 2004/06/20 22:45:56+02:00 [email protected] +7 -5
# [NETFILTER]: Relax hook check in ipt_CLASSIFY
#

net/ipv4/netfilter/ipt_CLASSIFY.c +7 -5
diff -Nru a/net/ipv4/netfilter/ipt_CLASSIFY.c b/net/ipv4/netfilter/ipt_CLASSIFY.c
@@ -54,15 +54,17 @@
 		return 0;
 	}
 	
-	if (hook_mask & ~(1 << NF_IP_POST_ROUTING)) {
-		printk(KERN_ERR "CLASSIFY: only valid in POST_ROUTING.\n");
+	if (hook_mask & ~((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
+	                  (1 << NF_IP_POST_ROUTING))) {
+		printk(KERN_ERR "CLASSIFY: only valid in LOCAL_OUT, FORWARD "
+		                "and POST_ROUTING.\n");
 		return 0;
 	}
 
 	if (strcmp(tablename, "mangle") != 0) {
-		printk(KERN_WARNING "CLASSIFY: can only be called from "
-		                    "\"mangle\" table, not \"%s\".\n",
-		                    tablename);
+		printk(KERN_ERR "CLASSIFY: can only be called from "
+		                "\"mangle\" table, not \"%s\".\n",
+		                tablename);
 		return 0;
 	}