aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/sch_netem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index c5bd8064e6d8..a08ec4c7c55d 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -148,7 +148,8 @@ static long tabledist(unsigned long mu, long sigma,
148static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) 148static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
149{ 149{
150 struct netem_sched_data *q = qdisc_priv(sch); 150 struct netem_sched_data *q = qdisc_priv(sch);
151 struct netem_skb_cb *cb = (struct netem_skb_cb *)skb->cb; 151 /* We don't fill cb now as skb_unshare() may invalidate it */
152 struct netem_skb_cb *cb;
152 struct sk_buff *skb2; 153 struct sk_buff *skb2;
153 int ret; 154 int ret;
154 int count = 1; 155 int count = 1;
@@ -200,6 +201,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
200 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); 201 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
201 } 202 }
202 203
204 cb = (struct netem_skb_cb *)skb->cb;
203 if (q->gap == 0 /* not doing reordering */ 205 if (q->gap == 0 /* not doing reordering */
204 || q->counter < q->gap /* inside last reordering gap */ 206 || q->counter < q->gap /* inside last reordering gap */
205 || q->reorder < get_crandom(&q->reorder_cor)) { 207 || q->reorder < get_crandom(&q->reorder_cor)) {