]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: sched: remove TC_MUNGED bits
authorFlorian Westphal <fw@strlen.de>
Thu, 30 Apr 2015 10:12:00 +0000 (12:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 May 2015 02:25:17 +0000 (22:25 -0400)
Not used.

pedit sets TC_MUNGED when packet content was altered, but all the core
does is unset MUNGED again and then set OK2MUNGE.

And the latter isn't tested anywhere. So lets remove both
TC_MUNGED and TC_OK2MUNGE.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/tc-actions-env-rules.txt
include/net/sch_generic.h
include/uapi/linux/pkt_cls.h
net/sched/act_api.c
net/sched/act_pedit.c

index 70d6cf608251b5cc9b35550c72c2095f2a87c026..95c71716b2e29664e2f053da44746c568fd91bec 100644 (file)
@@ -14,8 +14,6 @@ resets them for you, so invoke skb_act_clone() rather than skb_clone().
 
 2) If you munge any packet thou shalt call pskb_expand_head in the case
 someone else is referencing the skb. After that you "own" the skb.
-You must also tell us if it is ok to munge the packet (TC_OK2MUNGE),
-this way any action downstream can stomp on the packet.
 
 3) Dropping packets you don't own is a no-no. You simply return
 TC_ACT_SHOT to the caller and they will drop it.
index 6d778efcfdfd6c8a3973e03424625667ec350c3e..994b5a092f33f00812cb74e61e02bd96b52bad93 100644 (file)
@@ -755,8 +755,6 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
 
        if (n) {
                n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
-               n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
-               n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
        }
        return n;
 }
index bf08e76bf50525912360edbfe09b1e220f683e94..6810ca43a80a084b62de5ae48cd2a5f4607d888d 100644 (file)
@@ -35,6 +35,8 @@ bits 9,10,11: redirect counter -  redirect TTL. Loop avoidance
  *
  * */
 
+#ifndef __KERNEL__
+/* backwards compat for userspace only */
 #define TC_MUNGED          _TC_MAKEMASK1(0)
 #define SET_TC_MUNGED(v)   ( TC_MUNGED | (v & ~TC_MUNGED))
 #define CLR_TC_MUNGED(v)   ( v & ~TC_MUNGED)
@@ -42,6 +44,7 @@ bits 9,10,11: redirect counter -  redirect TTL. Loop avoidance
 #define TC_OK2MUNGE        _TC_MAKEMASK1(1)
 #define SET_TC_OK2MUNGE(v)   ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
 #define CLR_TC_OK2MUNGE(v)   ( v & ~TC_OK2MUNGE)
+#endif
 
 #define S_TC_VERD          _TC_MAKE32(2)
 #define M_TC_VERD          _TC_MAKEMASK(4,S_TC_VERD)
index 3d43e4979f27c8dca3083c863549592216f741fe..af427a3dbcba238103169ab2a58005feda5fa2f1 100644 (file)
@@ -392,11 +392,6 @@ int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
        list_for_each_entry(a, actions, list) {
 repeat:
                ret = a->ops->act(skb, a, res);
-               if (TC_MUNGED & skb->tc_verd) {
-                       /* copied already, allow trampling */
-                       skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
-                       skb->tc_verd = CLR_TC_MUNGED(skb->tc_verd);
-               }
                if (ret == TC_ACT_REPEAT)
                        goto repeat;    /* we need a ttl - JHS */
                if (ret != TC_ACT_PIPE)
index 59649d588d79d6d05c47e3a111fa1dd0397c7342..17e6d6669c7fdf138915ac9549d3f06d9535d745 100644 (file)
@@ -108,7 +108,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
                     struct tcf_result *res)
 {
        struct tcf_pedit *p = a->priv;
-       int i, munged = 0;
+       int i;
        unsigned int off;
 
        if (skb_unclone(skb, GFP_ATOMIC))
@@ -156,11 +156,8 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
                        *ptr = ((*ptr & tkey->mask) ^ tkey->val);
                        if (ptr == &_data)
                                skb_store_bits(skb, off + offset, ptr, 4);
-                       munged++;
                }
 
-               if (munged)
-                       skb->tc_verd = SET_TC_MUNGED(skb->tc_verd);
                goto done;
        } else
                WARN(1, "pedit BUG: index %d\n", p->tcf_index);