mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
[PATCH] netem: duplication fix
Netem duplication can cause infinite loop in qdisc_run because the qlen of the parent qdisc is not affected by the duplication. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c5187a4029
commit
03cc725bc4
1 changed files with 8 additions and 3 deletions
|
@ -184,10 +184,15 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
|||
/* Random duplication */
|
||||
if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor)) {
|
||||
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
|
||||
if (skb2) {
|
||||
struct Qdisc *rootq = sch->dev->qdisc;
|
||||
u32 dupsave = q->duplicate;
|
||||
|
||||
pr_debug("netem_enqueue: dup %p\n", skb2);
|
||||
if (skb2)
|
||||
delay_skb(sch, skb2);
|
||||
/* prevent duplicating a dup... */
|
||||
q->duplicate = 0;
|
||||
rootq->enqueue(skb2, rootq);
|
||||
q->duplicate = dupsave;
|
||||
}
|
||||
}
|
||||
|
||||
/* If doing simple delay then gap == 0 so all packets
|
||||
|
|
Loading…
Reference in a new issue