Hello again,

When running some connectivity tests, I discovered that UDP communication would not work between my nodes. Looking at the various printk() in the kernel, I found out that the IPv6 next header field is not set (set to 0) upon decompression and thus prevented correct processing of the decompressed packet at the upper layer (IPv6 layer). When the next header is UDP, IPHC next header compression applies (as defined in Section 4.1 of RFC6282). The compression code in 6lowpan.c seems to behave correctly. However, upon decompression code (in lowpan_process_data()) fails to properly restore/set the next header field.

I attached a (very small) patch for this issue to this mail. It works in my configuration and enables the two nodes to communicate. I do not believe it will introduce any side-effects.

Regards,
Tony
From d3a296699f98a74b560476e3b5baa53aec13302a Mon Sep 17 00:00:00 2001
From: Tony Cheneau <tony.chen...@amnesiak.org>
Date: Mon, 21 May 2012 14:40:24 -0400
Subject: [PATCH 1/1] Next header was not properly set upon decompression of
 a UDP header.

---
 net/ieee802154/6lowpan.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 34c7dda..079b0e7 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -936,8 +936,12 @@ lowpan_process_data(struct sk_buff *skb)
 
 	/* UDP data uncompression */
 	if (iphc0 & LOWPAN_IPHC_NH_C)
+    {
 		if (lowpan_uncompress_udp_header(skb))
 			goto drop;
+		hdr.nexthdr = UIP_PROTO_UDP;  
+    }
+   
 
 	/* Not fragmented package */
 	hdr.payload_len = htons(skb->len);
-- 
1.7.6.5

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to