From 1498495768677132a83889d0dd064563a0c0ea03 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 4 Sep 2024 20:46:44 +0200 Subject: network buffer fix --- fw/esp32/components/eos/rng.c | 2 +- fw/esp32/components/eos/sock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'fw/esp32/components/eos') diff --git a/fw/esp32/components/eos/rng.c b/fw/esp32/components/eos/rng.c index ca9e051..3927df1 100644 --- a/fw/esp32/components/eos/rng.c +++ b/fw/esp32/components/eos/rng.c @@ -14,7 +14,7 @@ static void rng_handler(unsigned char _mtype, unsigned char *buffer, uint16_t bu rng_len = (uint16_t)buffer[0] << 8; rng_len |= (uint16_t)buffer[1]; - if (rng_len > EOS_NET_MTU) { + if (rng_len > EOS_NET_SIZE_BUF) { rng_len = 0; goto rng_handler_fin; } diff --git a/fw/esp32/components/eos/sock.c b/fw/esp32/components/eos/sock.c index e1b703f..08d95d5 100644 --- a/fw/esp32/components/eos/sock.c +++ b/fw/esp32/components/eos/sock.c @@ -84,7 +84,7 @@ static void udp_rcvr_task(void *pvParameters) { ssize_t rv; buf = eos_net_alloc(); - rv = t_recvfrom(sock, buf + EOS_SOCK_SIZE_UDP_HDR, EOS_NET_MTU - EOS_SOCK_SIZE_UDP_HDR, &addr); + rv = t_recvfrom(sock, buf + EOS_SOCK_SIZE_UDP_HDR, EOS_NET_SIZE_BUF - EOS_SOCK_SIZE_UDP_HDR, &addr); if (rv < 0) { eos_net_free(buf); ESP_LOGE(TAG, "UDP RECV ERR:%d", rv); -- cgit v1.2.3