Skip to contentSkip to conversation

netem: memory leak

PATCH Applied Stephen Hemminger 2 participants 2 messages Feb 4, 2005 – Feb 7, 2005 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 netem: memory leak

Good catch.. netem needs to free skb's that are dropped due to loss simulation.

net/sched/sch_netem.c +1 -0
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
@@ -177,6 +177,7 @@
 	if (q->loss && q->loss >= get_crandom(&q->loss_cor)) {
 		pr_debug("netem_enqueue: random loss\n");
 		sch->qstats.drops++;
+		kfree_skb(skb);
 		return 0;	/* lie about loss so TCP doesn't know */
 	}
 
maintainer Applied
#2 lore raw
Quoted 2 lines · On Fri, 4 Feb 2005 15:31:08 -0800 Stephen Hemminger <[email protected]> wrote:

Good catch.. netem needs to free skb's that are dropped due to loss simulation.

Applied to 2.6.x and backported to 2.4.x, thanks Stephen.