diff --git a/ChangeLog b/ChangeLog index 6310804795c4b507cf1ea48609b3f9b638453248..f928eb02e8d59e084536d31e83fc1ef5c02be44a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -572,4 +572,8 @@ to refill the input buffer. The old behavior (read full blocks) might be useful in other contexts, so it is still available within the driver as a configuration option. * Implement poll() and select() support for TCP/IP sockets + * Fixed an important bug in the TCP/IP buffering logic. When TCP/IP read-ahead is enabled + and not recv() is in-place when a TCP/IP packet is received, the packet is placed into + a read-ahead buffer. However, the old contents of the read-ahead buffer were not being + cleared and old data would contaminate the newly received buffer. diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 3273b7d95fc2603d6d29942f0c5587418db9e8c2..39ba8dcc358b2047f6064c07a3a3bd15be1f92b2 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -1208,6 +1208,10 @@ nuttx-0.3.19 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> to refill the input buffer. The old behavior (read full blocks) might be useful in other contexts, so it is still available within the driver as a configuration option. * Implement poll() and select() support for TCP/IP sockets + * Fixed an important bug in the TCP/IP buffering logic. When TCP/IP read-ahead is enabled + and not recv() is in-place when a TCP/IP packet is received, the packet is placed into + a read-ahead buffer. However, the old contents of the read-ahead buffer were not being + cleared and old data would contaminate the newly received buffer. pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/net/uip/uip-tcpcallback.c b/net/uip/uip-tcpcallback.c index b99e41f9f82259d86fc10476c8a4802c64171101..71a2696d978b78604de21dbbffdcf3a580dae1f7 100644 --- a/net/uip/uip-tcpcallback.c +++ b/net/uip/uip-tcpcallback.c @@ -172,6 +172,7 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags) if (readahead2) { + readahead2->rh_nbytes = 0; (void)uip_readahead(readahead2, buf, buflen); /* Save the readahead buffer in the connection structure where