From: Florian Westphal <fw@strlen.de>
To: <netdev@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH v2] net: bridge: add compile-time assert for cb struct size
Date: Tue, 3 Mar 2015 13:53:31 +0100 [thread overview]
Message-ID: <1425387211-16807-1-git-send-email-fw@strlen.de> (raw)
make build fail if structure no longer fits into ->cb storage.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
Change since v1: use FIELD_SIZEOF
checkpatch complains about >80 chars, but line break is ugly here.
diff --git a/net/bridge/br.c b/net/bridge/br.c
index fb57ab6..02c24cf 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -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");
--
2.0.5
next reply other threads:[~2015-03-03 12:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 12:53 Florian Westphal [this message]
2015-03-03 13:50 ` [PATCH v2] net: bridge: add compile-time assert for cb struct size David Laight
2015-03-03 14:07 ` Eric Dumazet
2015-03-03 14:15 ` David Laight
2015-03-03 14:33 ` Eric Dumazet
2015-03-03 14:28 ` Daniel Borkmann
2015-03-03 14:44 ` David Laight
2015-03-03 14:51 ` Eyal Birger
2015-03-03 19:07 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425387211-16807-1-git-send-email-fw@strlen.de \
--to=fw@strlen.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).