diff --git a/CHANGELOG b/CHANGELOG index 733efbd0..fee12077 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -249,6 +249,9 @@ HISTORY ++ Bugfixes: + 2015-08-25: Simon Goldschmidt + * sockets.c: fixed bug #45827: recvfrom: TCP window is updated with MSG_PEEK + 2015-08-20: Manoj Kumar * snmp_msg.h, msg_in.c: fixed bug #43790: Sending octet string of Length >255 from SNMP agent diff --git a/src/api/sockets.c b/src/api/sockets.c index c1539b91..d6019113 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -907,11 +907,13 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, } else { netbuf_delete((struct netbuf *)buf); } + buf = NULL; } } } while (!done); - if ((off > 0) && (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP)) { + if ((off > 0) && (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) && + ((flags & MSG_PEEK) == 0)) { /* update receive window */ netconn_recved(sock->conn, (u32_t)off); }