Skip to content

Commit

Permalink
net: bridge: add compile-time assert for cb struct size
Browse files Browse the repository at this point in the history
make build fail if structure no longer fits into ->cb storage.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Mar 3, 2015
1 parent acf8dd0 commit 71e168b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/bridge/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ static int __init br_init(void)
{
int err;

BUILD_BUG_ON(sizeof(struct br_input_skb_cb) > FIELD_SIZEOF(struct sk_buff, cb));

err = stp_proto_register(&br_stp_proto);
if (err < 0) {
pr_err("bridge: can't register sap for STP\n");
Expand Down

0 comments on commit 71e168b

Please sign in to comment.