netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit
@ 2009-06-17 15:23 Stephen Hemminger
  2009-06-17 16:37 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2009-06-17 15:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, David Miller; +Cc: netdev

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit
  2009-06-17 15:23 [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit Stephen Hemminger
@ 2009-06-17 16:37 ` Arnaldo Carvalho de Melo
  2009-06-18  1:53   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-06-17 16:37 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, netdev

Em Wed, Jun 17, 2009 at 08:23:27AM -0700, Stephen Hemminger escreveu:
> 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>

Yeah, looks right, I forgot to initialize it to the value I changed the
test in skb_mac_header_was_set when doing the offset patch :-\

Thanks!

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit
  2009-06-17 16:37 ` Arnaldo Carvalho de Melo
@ 2009-06-18  1:53   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-06-18  1:53 UTC (permalink / raw)
  To: acme; +Cc: shemminger, netdev

From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Wed, 17 Jun 2009 13:37:16 -0300

> Em Wed, Jun 17, 2009 at 08:23:27AM -0700, Stephen Hemminger escreveu:
>> 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>
> 
> Yeah, looks right, I forgot to initialize it to the value I changed the
> test in skb_mac_header_was_set when doing the offset patch :-\
> 
> Thanks!
> 
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-18  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 15:23 [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit Stephen Hemminger
2009-06-17 16:37 ` Arnaldo Carvalho de Melo
2009-06-18  1:53   ` David Miller

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).