net: net_app: set packet data_len on incoming packets

This fixes a bug when calling net_pkt_append[_all] which uses
pkt->data_len as part of the maximum packet length calculation
when the net_context is set.

Without this change the maximum packet length is calculated as 0
(the value of pkt->data_len) and an ENOMEM error is returned.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
This commit is contained in:
Michael Scott 2017-12-20 10:59:59 -08:00 committed by Anas Nashif
parent e71f95b946
commit 3599d793c2

View file

@ -2068,6 +2068,7 @@ reset:
ctx->tls.mbedtls.ssl_ctx.hdr = NULL;
}
pkt->data_len = len;
ret = net_pkt_append_all(pkt, len,
ctx->tls.request_buf,
BUF_ALLOC_TIMEOUT);