aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-06-17 01:23:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-17 21:46:03 -0400
commit19633e129c65e5bb62b1af545c5479afcdb01fc4 (patch)
tree6b749f02863fc1ae1d3ec9953e2fe60d1db2064a /net/core
parentc564039fd83ea16a86a96d52632794b24849e507 (diff)
skbuff: skb_mac_header_was_set is always true on >32 bit
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. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 1a94a3037370..436695d8deb8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -201,6 +201,10 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
201 skb->data = data; 201 skb->data = data;
202 skb_reset_tail_pointer(skb); 202 skb_reset_tail_pointer(skb);
203 skb->end = skb->tail + size; 203 skb->end = skb->tail + size;
204#ifdef NET_SKBUFF_DATA_USES_OFFSET
205 skb->mac_header = ~0U;
206#endif
207
204 /* make sure we initialize shinfo sequentially */ 208 /* make sure we initialize shinfo sequentially */
205 shinfo = skb_shinfo(skb); 209 shinfo = skb_shinfo(skb);
206 atomic_set(&shinfo->dataref, 1); 210 atomic_set(&shinfo->dataref, 1);