From 28f0bbd575b8515b270a366886c7784aae59e359 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 8 Jan 2010 14:51:14 +0000 Subject: [PATCH] Fixed bug #28519 (lwip_recvfrom bug with len > 65535) --- CHANGELOG | 3 +++ src/api/sockets.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 909f547b..e564475e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,9 @@ HISTORY ++ Bugfixes: + 2010-01-08: Simon Goldschmidt + * sockets.c: Fixed bug #28519 (lwip_recvfrom bug with len > 65535) + 2010-01-08: Simon Goldschmidt * dns.c: Copy hostname for DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1 since string passed to dns_local_addhost() might be volatile diff --git a/src/api/sockets.c b/src/api/sockets.c index 340c6dcf..44318219 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -477,7 +477,8 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, { struct lwip_socket *sock; struct netbuf *buf; - u16_t buflen, copylen, off = 0; + u16_t buflen, copylen; + int off = 0; struct ip_addr *addr; u16_t port; u8_t done = 0; @@ -526,7 +527,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, } buflen = netbuf_len(buf); - LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: buflen=%"U16_F" len=%"SZT_F" off=%"U16_F" sock->lastoffset=%"U16_F"\n", + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: buflen=%"U16_F" len=%"SZT_F" off=%d sock->lastoffset=%"U16_F"\n", buflen, len, off, sock->lastoffset)); buflen -= sock->lastoffset; @@ -583,7 +584,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): addr=", s)); ip_addr_debug_print(SOCKETS_DEBUG, addr); - LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%"U16_F"\n", port, off)); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, off)); } else { #if SOCKETS_DEBUG struct sockaddr_in sin; @@ -598,7 +599,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): addr=", s)); ip_addr_debug_print(SOCKETS_DEBUG, addr); - LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%"U16_F"\n", port, off)); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, off)); #endif /* SOCKETS_DEBUG */ } }