diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-06 15:14:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-29 16:33:44 -0800 |
commit | c3e8445f6ec4ad66c5143d6df8528f7440429b91 (patch) | |
tree | 072851c9d86bddca227dd320421129e44702dbbb /include | |
parent | bbb8ae42eb210ba2bdff67450f3737e10cb042f3 (diff) |
net: Make qdisc_skb_cb upper size bound explicit.
[ Upstream commit 16bda13d90c8d5da243e2cfa1677e62ecce26860 ]
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 <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sch_generic.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index b931f021d7a..f1fbe2d5e05 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -219,9 +219,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(struct Qdisc *q) { return q->q.qlen; |