Fixed endianess of EoE parameters.

This commit is contained in:
Florian Pose 2016-05-03 14:13:11 +02:00 committed by Bjarne von Horn
parent 4d47f0b328
commit 7b2084e270
1 changed files with 8 additions and 4 deletions

View File

@ -212,22 +212,26 @@ int ec_fsm_eoe_prepare_set(
}
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;
}