Stateless compression mode 3 needs the MAC address from the MAC header.
This patch fixes the call to lowpan_uncompress_addr to correctly
pass the MAC address.

Signed-off-by: Ralph Droms <rdr...@cisco.com>
---
 net/ieee802154/6lowpan.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index a7bac63..996f697 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -913,7 +913,7 @@ lowpan_process_data(struct sk_buff *skb)
        }
 
        /* Extract SAM to the tmp variable */
-       tmp = ((iphc1 & LOWPAN_IPHC_SAM) >> LOWPAN_IPHC_SAM_BIT) & 0x03;
+       tmp = ((iphc1 & LOWPAN_IPHC_SAM) >> LOWPAN_IPHC_SAM_BIT);
 
        /* Source address uncompression */
        pr_debug("source address uncompression - SAM %d\n", tmp);
@@ -923,7 +923,8 @@ lowpan_process_data(struct sk_buff *skb)
        } else {
                pr_debug("stateless source uncompression\n");
                err = lowpan_uncompress_addr(skb, &hdr.saddr, lowpan_llprefix,
-                                       lowpan_unc_slconf[tmp], skb->data);
+                                            lowpan_unc_slconf[tmp],
+                                            mac_cb(skb)->sa.hwaddr);
                if (err)
                        goto drop;
        }
-- 
1.7.7.6


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to