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:
parent
0a97b09b0e
commit
810c510664
1 changed files with 1 additions and 1 deletions
|
@ -607,7 +607,7 @@ coap_context_send_message(coap_context_t *coap_ctx,
|
||||||
* set the send buffer length correctly.
|
* set the send buffer length correctly.
|
||||||
*/
|
*/
|
||||||
uip_len(coap_ctx->buf) = 0;
|
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);
|
ret = coap_context_reply(coap_ctx, coap_ctx->buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue