From 7c8b4c1a8b8278d864649c127857e34a6bd29504 Mon Sep 17 00:00:00 2001
From: Daniel Campora <daniel@wipy.io>
Date: Sat, 25 Apr 2015 17:54:48 +0200
Subject: [PATCH] cc3200: Correct MAKE_SOCKADDR and UNPACK_SOCKADDR byte order.

---
 cc3200/mods/modwlan.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c
index 6f3c21ca4..ce0a73d54 100644
--- a/cc3200/mods/modwlan.c
+++ b/cc3200/mods/modwlan.c
@@ -137,16 +137,16 @@ typedef struct _wlan_obj_t {
                                             addr.sa_family = AF_INET; \
                                             addr.sa_data[0] = port >> 8; \
                                             addr.sa_data[1] = port; \
-                                            addr.sa_data[2] = ip[0]; \
-                                            addr.sa_data[3] = ip[1]; \
-                                            addr.sa_data[4] = ip[2]; \
-                                            addr.sa_data[5] = ip[3];
+                                            addr.sa_data[2] = ip[3]; \
+                                            addr.sa_data[3] = ip[2]; \
+                                            addr.sa_data[4] = ip[1]; \
+                                            addr.sa_data[5] = ip[0];
 
 #define UNPACK_SOCKADDR(addr, ip, port)     port = (addr.sa_data[0] << 8) | addr.sa_data[1]; \
-                                            ip[0] = addr.sa_data[2]; \
-                                            ip[1] = addr.sa_data[3]; \
-                                            ip[2] = addr.sa_data[4]; \
-                                            ip[3] = addr.sa_data[5];
+                                            ip[0] = addr.sa_data[5]; \
+                                            ip[1] = addr.sa_data[4]; \
+                                            ip[2] = addr.sa_data[3]; \
+                                            ip[3] = addr.sa_data[2];
 
 /******************************************************************************
  DECLARE PRIVATE DATA
-- 
GitLab