]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NET_CLS_ACT]: Introduce skb_act_clone
authorJamal Hadi Salim <hadi@cyberus.ca>
Fri, 26 Oct 2007 09:47:23 +0000 (02:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Oct 2007 09:47:23 +0000 (02:47 -0700)
Reworked skb_clone looks uglier with the single ifdef
CONFIG_NET_CLS_ACT This patch introduces skb_act_clone which will
replace skb_clone in tc actions

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h

index a02ec9e5fea51934666d4b18085b0bcbd682f86a..c9265518a378ac6ca93ab1a74745d8149d8fcf2b 100644 (file)
@@ -316,4 +316,19 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
        return rtab->data[slot];
 }
 
+#ifdef CONFIG_NET_CLS_ACT
+static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
+{
+       struct sk_buff *n = skb_clone(skb, 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);
+               n->iif = skb->iif;
+       }
+       return n;
+}
+#endif
+
 #endif