[RIOT] coap_io.c: set length in received packet

This commit is contained in:
Olaf Bergmann committed 2019-03-15 10:33:01 +01:00
1 parent d65183a946
commit 787f999f35
1 file changed
+2
+2
View File
@@ -1137,6 +1137,8 @@ coap_network_read(coap_socket_t *sock, coap_packet_t *packet) {
packet->src.size = sizeof(packet->src.addr);
len = recvfrom (sock->fd, packet->payload, COAP_RXBUFFER_SIZE,
0, &packet->src.addr.sa, &packet->src.size);
packet->ifindex = sock->fd;
packet->length = (len > 0) ? len : 0;
if (LOG_DEBUG <= coap_get_log_level()) {
unsigned char addr_str[INET6_ADDRSTRLEN + 8];