Without this patch the client will endianes swap the port number when
sending the detailed request after it got the answer for his multicast
get. Use the same method for storing the port number in the address
array in ever part of the code and do not use memcpy and manual
bytewise coping mixed over the code. memcpy was used once and byte wise
copy was used twice so I choose the majority.
This was tested on MIPS BE 32 Bit.
Change-Id: Ib486171987004d10209d2bbf6b1d9ada75235651
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1220
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Doug Hudson <douglas.hudson@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
address->addr[i] = atoi(tok);
}
- memcpy(&address->addr[4], &endPoint->addressInfo.IP.port, sizeof(uint16_t));
+ address->addr[4] = (uint8_t)endPoint->addressInfo.IP.port;
+ address->addr[5] = (uint8_t)(endPoint->addressInfo.IP.port >> 8);
ret = OC_STACK_OK;
exit: