net: coap: Fix wrong app data

CoAP context send message data pointer is internal to coap.
ip_buf_appdata points &uip_buf(buf)[UIP_IPUDPH_LEN]. coap
internal data pointer assignment to ip_buf_appdata is wrong.
So copy data to ip_buf_appdata.

Change-Id: I3f11da382a227572c9080b210104a5b8e3dc34b4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2015-12-22 11:14:10 +02:00 committed by Anas Nashif
commit 810c510664

View file

@ -607,7 +607,7 @@ coap_context_send_message(coap_context_t *coap_ctx,
* set the send buffer length correctly.
*/
uip_len(coap_ctx->buf) = 0;
ip_buf_appdata(coap_ctx->buf) = (uint8_t *)data;
memcpy(ip_buf_appdata(coap_ctx->buf), data, length);
ret = coap_context_reply(coap_ctx, coap_ctx->buf);
}