summaryrefslogtreecommitdiffstats
path: root/net/sched/ipt.c
diff options
context:
space:
mode:
authorPatrick McHardy2006-01-09 07:15:34 +0100
committerDavid S. Miller2006-01-09 23:16:08 +0100
commitf43c5a0df38e12f53a3023175a12da9b7ef0df63 (patch)
tree9568a14353e93cffc0f59525c069b68305479520 /net/sched/ipt.c
parent[PKT_SCHED]: Use USEC_PER_SEC (diff)
downloadkernel-qcow2-linux-f43c5a0df38e12f53a3023175a12da9b7ef0df63.tar.gz
kernel-qcow2-linux-f43c5a0df38e12f53a3023175a12da9b7ef0df63.tar.xz
kernel-qcow2-linux-f43c5a0df38e12f53a3023175a12da9b7ef0df63.zip
[PKT_SCHED]: Convert tc action functions to single skb pointers
tcf_action_exec only gets a single skb pointer and doesn't own the skb, but passes double skb pointers (to a local variable) to the action functions. Change to use single skb pointers everywhere. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/ipt.c')
-rw-r--r--net/sched/ipt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/ipt.c b/net/sched/ipt.c
index f50136eed211..b5001939b74b 100644
--- a/net/sched/ipt.c
+++ b/net/sched/ipt.c
@@ -201,11 +201,10 @@ tcf_ipt_cleanup(struct tc_action *a, int bind)
}
static int
-tcf_ipt(struct sk_buff **pskb, struct tc_action *a, struct tcf_result *res)
+tcf_ipt(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res)
{
int ret = 0, result = 0;
struct tcf_ipt *p = PRIV(a, ipt);
- struct sk_buff *skb = *pskb;
if (skb_cloned(skb)) {
if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
@@ -222,6 +221,9 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a, struct tcf_result *res)
worry later - danger - this API seems to have changed
from earlier kernels */
+ /* iptables targets take a double skb pointer in case the skb
+ * needs to be replaced. We don't own the skb, so this must not
+ * happen. The pskb_expand_head above should make sure of this */
ret = p->t->u.kernel.target->target(&skb, skb->dev, NULL,
p->hook, p->t->data, NULL);
switch (ret) {