summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2008-07-20 09:08:47 +0200
committerDavid S. Miller <davem@davemloft.net>2008-07-20 09:08:47 +0200
commit175f9c1bba9b825d22b142d183c9e175488b260c (patch)
tree6b9cdb2e3802e7fc8422dc0d0cc200f6d4d1d0a5 /net/sched/sch_netem.c
parentnet_sched: Add accessor function for packet length for qdiscs (diff)
downloadlinux-175f9c1bba9b825d22b142d183c9e175488b260c.tar.xz
linux-175f9c1bba9b825d22b142d183c9e175488b260c.zip
net_sched: Add size table for qdiscs
Add size table functions for qdiscs and calculate packet size in qdisc_enqueue(). Based on patch by Patrick McHardy http://marc.info/?l=linux-netdev&m=115201979221729&w=2 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index ae49be00022f..a59085700678 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -84,8 +84,9 @@ struct netem_skb_cb {
static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
{
- BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct netem_skb_cb));
- return (struct netem_skb_cb *)skb->cb;
+ BUILD_BUG_ON(sizeof(skb->cb) <
+ sizeof(struct qdisc_skb_cb) + sizeof(struct netem_skb_cb));
+ return (struct netem_skb_cb *)qdisc_skb_cb(skb)->data;
}
/* init_crandom - initialize correlated random number generator