path: root/include
diff options
authorDavid S. Miller <>2012-02-06 15:14:37 -0500
committerDavid S. Miller <>2012-02-06 15:14:37 -0500
commita0417fa3a18a14be1f4d9cffcf378a7c42d92a91 (patch)
tree4606685ea5ab5ebe33ad4335dc004c66ea31bdc2 /include
parentc056b734e54e12f38f34a2583a4824e6cecc16c1 (diff)
net: Make qdisc_skb_cb upper size bound explicit.
Just like skb->cb[], so that qdisc_skb_cb can be encapsulated inside of other data structures. This is intended to be used by IPoIB so that it can remember addressing information stored at hard_header_ops->create() time that it can fetch when the packet gets to the transmit routine. Signed-off-by: David S. Miller <>
Diffstat (limited to 'include')
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f6bb08b73ca..55ce96b53b0 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -220,9 +220,16 @@ struct tcf_proto {
struct qdisc_skb_cb {
unsigned int pkt_len;
- long data[];
+ unsigned char data[24];
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+ struct qdisc_skb_cb *qcb;
+ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(unsigned int) + sz);
+ BUILD_BUG_ON(sizeof(qcb->data) < sz);
static inline int qdisc_qlen(const struct Qdisc *q)
return q->q.qlen;