Bugzilla – Bug 1739
The endpoint is not deallocated for UDP sockets
Last modified: 2014-01-15 17:37:13 EST
Created attachment 1650 [details] Proposed patch When closing an UDP socket the endpoint is not deallocated (class UdpSocketImpl). A reference to the socket is kept in UdpL4Protocol::m_sockets, so the destructor of UdpSocketImpl is only invoked at the end of the simulation. A solution similar to that used for TCP sockets (class TcpSocketBase) can be used.
I'm not against it, but not as it is. 1) DeallocateEndPoint must also close IPv6's related endpoint, and 2) it must be triple checked that the proposed change does not cause memory leaks. Point 2 is becuase I know the TCP and UDP deallocation pain, since endpoints management is all but linear and obvious. If Valgrind and the tests don't complain, and provided the IPv6 is handled (it's very easy), I'm favourable to this change.
Created attachment 1763 [details] new patch Updated patch to build against ns-3-dev and cope with v6 endpoints (they wasn't there in 3.17). I'm running Valgrind. If all goes fine, I'll commit this. T.
Valgrind is happy. Pushed in changeset: 10575:16f8ac386faf