From ea184b59b18bfb193a86a942e1867eb167c90a7d Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Wed, 23 Oct 2013 21:16:15 +0200 Subject: [PATCH] print IPv6 addresses in host byte order --- sys/net/sixlowpan/ip.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/net/sixlowpan/ip.c b/sys/net/sixlowpan/ip.c index efc0648125..67f1e9ea9d 100644 --- a/sys/net/sixlowpan/ip.c +++ b/sys/net/sixlowpan/ip.c @@ -32,7 +32,6 @@ #include "lowpan.h" #include "net_help.h" -#include "msg_help.h" #define IP_PKT_RECV_BUF_SIZE (64) #define LLHDR_IPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN) @@ -593,10 +592,10 @@ char *ipv6_addr_to_str(char *addr_str, const ipv6_addr_t *ipv6_addr) { sprintf(addr_str, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", - ipv6_addr->uint16[0], ipv6_addr->uint16[1], - ipv6_addr->uint16[2], ipv6_addr->uint16[3], - ipv6_addr->uint16[4], ipv6_addr->uint16[5], - ipv6_addr->uint16[6], ipv6_addr->uint16[7]); + NTOHS(ipv6_addr->uint16[0]), NTOHS(ipv6_addr->uint16[1]), + NTOHS(ipv6_addr->uint16[2]), NTOHS(ipv6_addr->uint16[3]), + NTOHS(ipv6_addr->uint16[4]), NTOHS(ipv6_addr->uint16[5]), + NTOHS(ipv6_addr->uint16[6]), NTOHS(ipv6_addr->uint16[7])); return addr_str; }