From: Stephen Hemminger <shemminger@vyatta.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit
Date: Wed, 17 Jun 2009 08:23:27 -0700 [thread overview]
Message-ID: <20090617082327.196eda07@nehalam> (raw)
Looking at the crash in log_martians(), one suspect is that the check for
mac header being set is not correct. The value of mac_header defaults to
0 on allocation, therefore skb_mac_header_was_set will always be true on
platforms using NET_SKBUFF_USES_OFFSET.
Arnaldo, is this correct?
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/core/skbuff.c 2009-06-17 08:16:46.235188728 -0700
+++ b/net/core/skbuff.c 2009-06-17 08:17:25.810314332 -0700
@@ -201,6 +201,10 @@ struct sk_buff *__alloc_skb(unsigned int
skb->data = data;
skb_reset_tail_pointer(skb);
skb->end = skb->tail + size;
+#ifdef NET_SKBUFF_DATA_USES_OFFSET
+ skb->mac_header = ~0U;
+#endif
+
/* make sure we initialize shinfo sequentially */
shinfo = skb_shinfo(skb);
atomic_set(&shinfo->dataref, 1);
next reply other threads:[~2009-06-17 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 15:23 Stephen Hemminger [this message]
2009-06-17 16:37 ` [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit Arnaldo Carvalho de Melo
2009-06-18 1:53 ` 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=20090617082327.196eda07@nehalam \
--to=shemminger@vyatta.com \
--cc=acme@ghostprotocols.net \
--cc=davem@davemloft.net \
--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).