summaryrefslogtreecommitdiffstats
path: root/kernel/net/sched/act_vlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/sched/act_vlan.c')
-rw-r--r--kernel/net/sched/act_vlan.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/net/sched/act_vlan.c b/kernel/net/sched/act_vlan.c
index 796785e0b..d7edba453 100644
--- a/kernel/net/sched/act_vlan.c
+++ b/kernel/net/sched/act_vlan.c
@@ -33,6 +33,12 @@ static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
bstats_update(&v->tcf_bstats, skb);
action = v->tcf_action;
+ /* Ensure 'data' points at mac_header prior calling vlan manipulating
+ * functions.
+ */
+ if (skb_at_tc_ingress(skb))
+ skb_push_rcsum(skb, skb->mac_len);
+
switch (v->tcfv_action) {
case TCA_VLAN_ACT_POP:
err = skb_vlan_pop(skb);
@@ -54,6 +60,9 @@ drop:
action = TC_ACT_SHOT;
v->tcf_qstats.drops++;
unlock:
+ if (skb_at_tc_ingress(skb))
+ skb_pull_rcsum(skb, skb->mac_len);
+
spin_unlock(&v->tcf_lock);
return action;
}