diff options
author | Eric Dumazet <edumazet@google.com> | 2014-09-18 11:00:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-22 14:29:55 -0400 |
commit | b49fe36208b45f76dfbcfcd3afd952a33fa9f5ce (patch) | |
tree | 817fda679469c34681c145c0191e90474348e7b4 /drivers/infiniband/ulp/ipoib/ipoib.h | |
parent | 257117862634d89de33fec74858b1a0ba5ab444b (diff) |
ipoib: validate struct ipoib_cb size
To catch future errors sooner.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib.h')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 3edce617c31b..d7562beb5423 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -131,6 +131,12 @@ struct ipoib_cb { u8 hwaddr[INFINIBAND_ALEN]; }; +static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb) +{ + BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb)); + return (struct ipoib_cb *)skb->cb; +} + /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ struct ipoib_mcast { struct ib_sa_mcmember_rec mcmember; |