Networking: Any linger UDP read-ahead buffers must be freed when UDP socket is closed
This commit is contained in:
parent
2a39105b3f
commit
4205d68505
|
@ -60,6 +60,7 @@
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
|
#include "iob/iob.h"
|
||||||
#include "udp/udp.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);
|
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 */
|
/* Free the connection */
|
||||||
|
|
||||||
dq_addlast(&conn->node, &g_free_udp_connections);
|
dq_addlast(&conn->node, &g_free_udp_connections);
|
||||||
|
|
Loading…
Reference in New Issue