diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-06 15:14:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-09 13:50:34 -0500 |
commit | 16bda13d90c8d5da243e2cfa1677e62ecce26860 (patch) | |
tree | d10c9e0f9b043170c5bba4599ab1dc006d2a76eb /include | |
parent | 9cc00b51a3cbb3b933065a55eaa9bfc306411b7a (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 <davem@davemloft.net>
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 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; |