From 634f875e19d0f22f2df1c47c31bbe5f77276663e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ho=C5=82enko?= Date: Tue, 16 May 2017 14:32:50 +0200 Subject: [PATCH] net: 6lo: Fix handling SAM_00 mode for packets with context The uncompressed source address in packets was not handled properly if NET_6LO_CONTEXT was enabled. This implementation is identical to the contextless case. Signed-off-by: Piotr Zierhoffer --- subsys/net/ip/6lo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subsys/net/ip/6lo.c b/subsys/net/ip/6lo.c index 923c6127b11..ab53cb9b7db 100644 --- a/subsys/net/ip/6lo.c +++ b/subsys/net/ip/6lo.c @@ -918,6 +918,12 @@ static inline u8_t uncompress_sa_ctx(struct net_pkt *pkt, } switch (CIPHC[1] & NET_6LO_IPHC_SAM_11) { + case NET_6LO_IPHC_SAM_00: + NET_DBG("SAM_00 full src addr inlined"); + + memcpy(ipv6->src.s6_addr, &CIPHC[offset], 16); + offset += 16; + break; case NET_6LO_IPHC_SAM_01: NET_DBG("SAM_01 last 64 bits are inlined");