From 82cb456e0237cd8b7f25e35670649035c147096b Mon Sep 17 00:00:00 2001 From: Ivan Ucherdzhiev Date: Wed, 8 May 2019 06:59:22 -0600 Subject: [PATCH] net/sixlowpan/sixlowpan_hc06.c: Correct an endian-ness problem in HC06 decompression. --- net/sixlowpan/sixlowpan_hc06.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sixlowpan/sixlowpan_hc06.c b/net/sixlowpan/sixlowpan_hc06.c index 668c0e7c1f..e9c260f40a 100644 --- a/net/sixlowpan/sixlowpan_hc06.c +++ b/net/sixlowpan/sixlowpan_hc06.c @@ -3,7 +3,7 @@ * 6lowpan HC06 implementation (draft-ietf-6lowpan-hc-06, updated to RFC * 6282) * - * Copyright (C) 2017, Gregory Nutt, all rights reserved + * Copyright (C) 2017, 2019 Gregory Nutt, all rights reserved * Author: Gregory Nutt * * Derives from Contiki: @@ -503,11 +503,11 @@ static void uncompress_addr(FAR const struct netdev_varaddr_s *addr, #ifdef CONFIG_ENDIAN_BIG /* Preserve big-endian, network order */ - ipaddr[destndx - 1] = (uint16_t)(*srcptr) << 8; + ipaddr[destndx - 1] = (uint16_t)(*srcptr); #else /* Preserve big-endian, network order */ - ipaddr[destndx - 1] = (uint16_t)(*srcptr); + ipaddr[destndx - 1] = (uint16_t)(*srcptr) << 8; #endif srcptr++;