Fixed endianess of EoE parameters.
authorFlorian Pose <fp@gh.de>
Tue, 03 May 2016 14:13:11 +0200
changeset 2642 9dc0b2262f90
parent 2641 535465bf176d
child 2643 adc81813fe16
Fixed endianess of EoE parameters.
master/fsm_eoe.c
--- a/master/fsm_eoe.c	Thu May 07 15:53:42 2015 +0200
+++ b/master/fsm_eoe.c	Tue May 03 14:13:11 2016 +0200
@@ -212,22 +212,26 @@
     }
 
     if (req->ip_address_included) {
-        memcpy(cur, &req->ip_address, 4);
+        uint32_t swapped = htonl(req->ip_address);
+        memcpy(cur, &swapped, 4);
         cur += 4;
     }
 
     if (req->subnet_mask_included) {
-        memcpy(cur, &req->subnet_mask, 4);
+        uint32_t swapped = htonl(req->subnet_mask);
+        memcpy(cur, &swapped, 4);
         cur += 4;
     }
 
     if (req->gateway_included) {
-        memcpy(cur, &req->gateway, 4);
+        uint32_t swapped = htonl(req->gateway);
+        memcpy(cur, &swapped, 4);
         cur += 4;
     }
 
     if (req->dns_included) {
-        memcpy(cur, &req->dns, 4);
+        uint32_t swapped = htonl(req->dns);
+        memcpy(cur, &swapped, 4);
         cur += 4;
     }