From 5a5bc4a61f660829b8f57c297ff90ec43f86b173 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 1 Jun 2018 13:44:09 +1000 Subject: [PATCH] drivers/wiznet5k: Fix bug with MACRAW socket calculating packet size. --- drivers/wiznet5k/ethernet/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/wiznet5k/ethernet/socket.c b/drivers/wiznet5k/ethernet/socket.c index ec25fcc793..3ffda3a722 100644 --- a/drivers/wiznet5k/ethernet/socket.c +++ b/drivers/wiznet5k/ethernet/socket.c @@ -525,6 +525,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_ // read peer's IP address, port number & packet length sock_remained_size[sn] = head[0]; sock_remained_size[sn] = (sock_remained_size[sn] <<8) + head[1]; + sock_remained_size[sn] -= 2; // len includes 2 len bytes if(sock_remained_size[sn] > 1514) { WIZCHIP_EXPORT(close)(sn);