diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-30 09:44:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-30 09:44:00 -0600 |
commit | 26555d8d49e6379bfb175439f29c30e2b4dbc239 (patch) | |
tree | d2235aa128566b02fc0e5ce146c5e68c655fe20c | |
parent | 3fa110d8bca649c3ffce76fde4314455a433af8a (diff) | |
download | nuttx-26555d8d49e6379bfb175439f29c30e2b4dbc239.tar.gz nuttx-26555d8d49e6379bfb175439f29c30e2b4dbc239.tar.bz2 nuttx-26555d8d49e6379bfb175439f29c30e2b4dbc239.zip |
Networking: Any linger UDP read-ahead buffers must be freed when UDP socket is closed
-rw-r--r-- | nuttx/net/udp/udp_conn.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nuttx/net/udp/udp_conn.c b/nuttx/net/udp/udp_conn.c index 3f2106da0..a72004318 100644 --- a/nuttx/net/udp/udp_conn.c +++ b/nuttx/net/udp/udp_conn.c @@ -60,6 +60,7 @@ #include "devif/devif.h" #include "netdev/netdev.h" +#include "iob/iob.h" #include "udp/udp.h" /**************************************************************************** @@ -489,6 +490,12 @@ void udp_free(FAR struct udp_conn_s *conn) dq_rem(&conn->node, &g_active_udp_connections); +#ifdef CONFIG_NET_UDP_READAHEAD + /* Release any read-ahead buffers attached to the connection */ + + iob_free_queue(&conn->readahead); +#endif + /* Free the connection */ dq_addlast(&conn->node, &g_free_udp_connections); |