Bug 1739 - The endpoint is not deallocated for UDP sockets
This commit is contained in:
@@ -29,6 +29,7 @@ New user-visible features
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
- Bug 1739 - The endpoint is not deallocated for UDP sockets
|
||||
- Bug 1786 - os << int64x64_t prints un-normalized fractional values
|
||||
- Bug 1821 - Setting an interface to Down state will cause various asserts in IPv6
|
||||
- Bug 1837 - AODV crashes when using multiple interfaces
|
||||
|
||||
@@ -341,7 +341,7 @@ protected:
|
||||
void Destroy6 (void);
|
||||
|
||||
/**
|
||||
* \brief Deallocate m_endPoint
|
||||
* \brief Deallocate m_endPoint and m_endPoint6
|
||||
*/
|
||||
void DeallocateEndPoint (void);
|
||||
|
||||
|
||||
@@ -180,6 +180,25 @@ UdpSocketImpl::Destroy6 (void)
|
||||
m_endPoint6 = 0;
|
||||
}
|
||||
|
||||
/* Deallocate the end point and cancel all the timers */
|
||||
void
|
||||
UdpSocketImpl::DeallocateEndPoint (void)
|
||||
{
|
||||
if (m_endPoint != 0)
|
||||
{
|
||||
m_endPoint->SetDestroyCallback (MakeNullCallback<void> ());
|
||||
m_udp->DeAllocate (m_endPoint);
|
||||
m_endPoint = 0;
|
||||
}
|
||||
if (m_endPoint6 != 0)
|
||||
{
|
||||
m_endPoint6->SetDestroyCallback (MakeNullCallback<void> ());
|
||||
m_udp->DeAllocate (m_endPoint6);
|
||||
m_endPoint6 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
UdpSocketImpl::FinishBind (void)
|
||||
{
|
||||
@@ -318,6 +337,7 @@ UdpSocketImpl::Close (void)
|
||||
}
|
||||
m_shutdownRecv = true;
|
||||
m_shutdownSend = true;
|
||||
DeallocateEndPoint ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,11 @@ private:
|
||||
*/
|
||||
void Destroy6 (void);
|
||||
|
||||
/**
|
||||
* \brief Deallocate m_endPoint and m_endPoint6
|
||||
*/
|
||||
void DeallocateEndPoint (void);
|
||||
|
||||
/**
|
||||
* \brief Send a packet
|
||||
* \param p packet
|
||||
|
||||
Reference in New Issue
Block a user