netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ipv6: fix headroom calculation in udp6_ufo_fragment
@ 2013-12-13 13:01 Mark Hambleton
  2013-12-13 13:14 ` Mark Brown
  2013-12-13 13:34 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Hambleton @ 2013-12-13 13:01 UTC (permalink / raw)
  To: 'Pravin B Shelar', 'Saran Neti',
	'David S. Miller', 'Greg Kroah-Hartman',
	'Hannes Frederic Sowa'
  Cc: Mark Brown (broonie@linaro.org), 'netdev@vger.kernel.org',
	'stable@vger.kernel.org'

Hi, 

Following a recent commit to LTS and upstream  I see the following warning emitted on an ARM32 build:

net/ipv6/udp_offload.c: In function 'udp6_ufo_fragment':
net/ipv6/udp_offload.c:88:22: error: comparison between pointer and integer [-Werror]
  if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) {
                      ^
cc1: all warnings being treated as errors
make[2]: *** [net/ipv6/udp_offload.o] Error 1
make[1]: *** [net/ipv6] Error 2

 The commit made the following changes:

-       if (skb_headroom(skb) < (tnl_hlen + frag_hdr_sz)) {
+       if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) {

Now, because of some defines in skbuff.h :

#if BITS_PER_LONG > 32
#define NET_SKBUFF_DATA_USES_OFFSET 1
#endif

#ifdef NET_SKBUFF_DATA_USES_OFFSET
typedef unsigned int sk_buff_data_t;
#else
typedef unsigned char *sk_buff_data_t;
#endif

On an ARM32 system sk_buff_data_t would be a pointer (long being 32 bits), meaning that skb->mac_header is a pointer and that  you are comparing a pointer against a length, which doesn't look like it is correct to me?

I can see how this works when NET_SKBUFF_DATA_USES_OFFSET is defined, but is there a way to do this that works for both cases?

Hope this makes sense, 

Mark

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

end of thread, other threads:[~2013-12-17 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-13 13:01 ipv6: fix headroom calculation in udp6_ufo_fragment Mark Hambleton
2013-12-13 13:14 ` Mark Brown
2013-12-13 13:34 ` Hannes Frederic Sowa
2013-12-13 13:42   ` Mark Brown
2013-12-13 14:12     ` Hannes Frederic Sowa
2013-12-13 15:00       ` Mark Hambleton
2013-12-17 20:01       ` 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).