net_sched: act: pick a different type for act_xt
authorWANG Cong <xiyou.wangcong@gmail.com>
Wed, 15 Jan 2014 23:38:43 +0000 (15:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2014 01:24:11 +0000 (17:24 -0800)
In tcf_register_action() we check either ->type or ->kind to see if
there is an existing action registered, but ipt action registers two
actions with same type but different kinds. They should have different
types too.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/tc_act/tc_ipt.h
net/sched/act_ipt.c

index a2335563d21f3c1048e1ef23362f9d11fcee6a75..130aaadf6fac9bf419c6ff13c7adae05c34f9b4c 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_IPT 6
+#define TCA_ACT_XT 10
 
 enum {
        TCA_IPT_UNSPEC,
index 484bd19601e36fdaa9df1d4e5c37d1b702ab5be6..bc9f498f6fef6d58a98b70770a454742a1952ebe 100644 (file)
@@ -298,7 +298,7 @@ static struct tc_action_ops act_ipt_ops = {
 static struct tc_action_ops act_xt_ops = {
        .kind           =       "xt",
        .hinfo          =       &ipt_hash_info,
-       .type           =       TCA_ACT_IPT,
+       .type           =       TCA_ACT_XT,
        .capab          =       TCA_CAP_NONE,
        .owner          =       THIS_MODULE,
        .act            =       tcf_ipt,