[Linux-zigbee-devel] [PATCH net-next 5/6] 6lowpan: udp use lowpan_fetch_skb function

2013-11-14 Thread Alexander Aring
Cleanup the lowpan_uncompress_udp_header function to use the lowpan_fetch_skb function. Signed-off-by: Alexander Aring --- net/ieee802154/6lowpan.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/net/ieee802154/6lowpan.c b/net/ieee80

[Linux-zigbee-devel] [PATCH net-next 0/6] 6lowpan: udp compression/uncompression fix

2013-11-14 Thread Alexander Aring
The current 6LoWPAN udp compression/uncompression is completely broken. This patch series fix a lot of udp compression/uncompression issues and add support parsing with lowpan_fetch_skb function. Alexander Aring (6): 6lowpan: fix udp nullpointer dereferencing 6lowpan: fix udp compress ordering

[Linux-zigbee-devel] [PATCH net-next 6/6] 6lowpan: udp use subtraction on both conditions

2013-11-14 Thread Alexander Aring
Cleanup code to handle both calculation in the same way. Signed-off-by: Alexander Aring --- net/ieee802154/6lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index 6d7f253..d8e1456 100644 --- a/net/ieee802154/6lowpan.

[Linux-zigbee-devel] [PATCH net-next 2/6] 6lowpan: fix udp compress ordering

2013-11-14 Thread Alexander Aring
In case ((ntohs(uh->source) & LOWPAN_NHC_UDP_8BIT_MASK) the order of uncompression is wrong. It's always first source port then destination port as second. See: http://tools.ietf.org/html/rfc6282#section-4.3.3 "Fields carried in-line (in part or in whole) appear in the same order as they do in th

[Linux-zigbee-devel] [PATCH net-next 3/6] 6lowpan: fix udp byte ordering

2013-11-14 Thread Alexander Aring
The incoming udp header in lowpan_compress_udp_header function is already in network byte order. Everytime we read this values for source and destination port we need to convert this value to host byte order. In the outcoming header we need to set this value in network byte order which the upcomi

[Linux-zigbee-devel] [PATCH net-next 4/6] 6lowpan: add udp warning for elided checksum

2013-11-14 Thread Alexander Aring
Bit 5 of "UDP LOWPAN_NHC Format" indicate that the checksum can be elided. The host need to calculate the udp checksum afterwards but this isn't supported right now. See: http://tools.ietf.org/html/rfc6282#section-4.3.3 Signed-off-by: Alexander Aring --- net/ieee802154/6lowpan.c | 11 ---

[Linux-zigbee-devel] [PATCH net-next 1/6] 6lowpan: fix udp nullpointer dereferencing

2013-11-14 Thread Alexander Aring
Sometimes a nullpointer dereferencing occurs because of using a wrong pointer arithmetic in udp_uncompression. This patch changes "**(hc06_ptr + 3)" to the right one "*(*hc06_ptr + 3)". Dereferencing like "**(hc06_ptr + 3)" works in a random case only. Signed-off-by: Alexander Aring --- net/iee

Re: [Linux-zigbee-devel] [PATCH net-next 0/6] 6lowpan: udp compression/uncompression fix

2013-11-14 Thread Eric Dumazet
On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: > The current 6LoWPAN udp compression/uncompression is completely broken. > This patch series fix a lot of udp compression/uncompression issues and > add support parsing with lowpan_fetch_skb function. If its broken, why targeting net-next

Re: [Linux-zigbee-devel] [PATCH net-next 4/6] 6lowpan: add udp warning for elided checksum

2013-11-14 Thread Joe Perches
On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: > Bit 5 of "UDP LOWPAN_NHC Format" indicate that the checksum can be elided. > The host need to calculate the udp checksum afterwards but this isn't > supported right now. [] > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c

Re: [Linux-zigbee-devel] [PATCH net-next 4/6] 6lowpan: add udp warning for elided checksum

2013-11-14 Thread Alexander Aring
On Thu, Nov 14, 2013 at 08:32:01AM -0800, Joe Perches wrote: > On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: > > Bit 5 of "UDP LOWPAN_NHC Format" indicate that the checksum can be elided. > > The host need to calculate the udp checksum afterwards but this isn't > > supported right now.

Re: [Linux-zigbee-devel] [PATCH net-next 0/6] 6lowpan: udp compression/uncompression fix

2013-11-14 Thread Alexander Aring
On Thu, Nov 14, 2013 at 08:19:43AM -0800, Eric Dumazet wrote: > On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: > > The current 6LoWPAN udp compression/uncompression is completely broken. > > This patch series fix a lot of udp compression/uncompression issues and > > add support parsing w

Re: [Linux-zigbee-devel] [PATCH net-next 1/6] 6lowpan: fix udp nullpointer dereferencing

2013-11-14 Thread Werner Almesberger
Alexander Aring wrote: > - **(hc06_ptr + 3) = (u8)(uh->dest - LOWPAN_NHC_UDP_8BIT_PORT); > + *(*hc06_ptr + 3) = (u8)(uh->dest - LOWPAN_NHC_UDP_8BIT_PORT); This patch series looks like having an opportunity for killing some unnecessary casts, too :) That is, unless you aim t

Re: [Linux-zigbee-devel] [PATCH net-next 0/6] 6lowpan: udp compression/uncompression fix

2013-11-14 Thread David Miller
From: Eric Dumazet Date: Thu, 14 Nov 2013 08:19:43 -0800 > On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: >> The current 6LoWPAN udp compression/uncompression is completely broken. >> This patch series fix a lot of udp compression/uncompression issues and >> add support parsing with lo

Re: [Linux-zigbee-devel] [PATCH net-next 0/6] 6lowpan: udp compression/uncompression fix

2013-11-14 Thread Alexander Aring
On Thu, Nov 14, 2013 at 05:06:20PM -0500, David Miller wrote: > From: Eric Dumazet > Date: Thu, 14 Nov 2013 08:19:43 -0800 > > > On Thu, 2013-11-14 at 16:48 +0100, Alexander Aring wrote: > >> The current 6LoWPAN udp compression/uncompression is completely broken. > >> This patch series fix a lot