View | Details | Raw Unified | Return to bug 1833
Collapse All | Expand All

(-)a/src/internet/model/udp-l4-protocol.h (+1 lines)
 Lines 250-255    Link Here 
250
   */
250
   */
251
  UdpL4Protocol &operator = (const UdpL4Protocol &);
251
  UdpL4Protocol &operator = (const UdpL4Protocol &);
252
252
253
  friend class UdpSocketImpl;
253
  std::vector<Ptr<UdpSocketImpl> > m_sockets;      //!< list of sockets
254
  std::vector<Ptr<UdpSocketImpl> > m_sockets;      //!< list of sockets
254
  IpL4Protocol::DownTargetCallback m_downTarget;   //!< Callback to send packets over IPv4
255
  IpL4Protocol::DownTargetCallback m_downTarget;   //!< Callback to send packets over IPv4
255
  IpL4Protocol::DownTargetCallback6 m_downTarget6; //!< Callback to send packets over IPv6
256
  IpL4Protocol::DownTargetCallback6 m_downTarget6; //!< Callback to send packets over IPv6
(-)a/src/internet/model/udp-socket-impl.cc (+34 lines)
 Lines 38-43    Link Here 
38
#include "ipv4-end-point.h"
38
#include "ipv4-end-point.h"
39
#include "ipv6-end-point.h"
39
#include "ipv6-end-point.h"
40
#include <limits>
40
#include <limits>
41
#include <algorithm>
41
42
42
NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl");
43
NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl");
43
44
 Lines 180-185    Link Here 
180
  m_endPoint6 = 0;
181
  m_endPoint6 = 0;
181
}
182
}
182
183
184
void
185
UdpSocketImpl::DeallocateEndPoint ()
186
{
187
  NS_LOG_FUNCTION_NOARGS ();
188
189
  if (m_endPoint != 0)
190
    {
191
      m_endPoint->SetDestroyCallback (MakeNullCallback<void> ());
192
      m_udp->DeAllocate (m_endPoint);
193
      m_endPoint = 0;
194
      std::vector<Ptr<UdpSocketImpl> >::iterator it
195
        = std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this);
196
      if (it != m_udp->m_sockets.end ())
197
        {
198
          m_udp->m_sockets.erase (it);
199
        }
200
    }
201
202
  if (m_endPoint6 != 0)
203
    {
204
      m_endPoint6->SetDestroyCallback (MakeNullCallback<void> ());
205
      m_udp->DeAllocate (m_endPoint6);
206
      m_endPoint6 = 0;
207
      std::vector<Ptr<UdpSocketImpl> >::iterator it
208
        = std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this);
209
      if (it != m_udp->m_sockets.end ())
210
        {
211
          m_udp->m_sockets.erase (it);
212
        }
213
    }
214
}
215
183
int
216
int
184
UdpSocketImpl::FinishBind (void)
217
UdpSocketImpl::FinishBind (void)
185
{
218
{
 Lines 318-323    Link Here 
318
    }
351
    }
319
  m_shutdownRecv = true;
352
  m_shutdownRecv = true;
320
  m_shutdownSend = true;
353
  m_shutdownSend = true;
354
  DeallocateEndPoint ();
321
  return 0;
355
  return 0;
322
}
356
}
323
357
(-)a/src/internet/model/udp-socket-impl.h (+5 lines)
 Lines 157-162    Link Here 
157
  void Destroy6 (void);
157
  void Destroy6 (void);
158
158
159
  /**
159
  /**
160
   * \brief Deallocate m_endPoint
161
   */
162
  void DeallocateEndPoint ();
163
164
  /**
160
   * \brief Send a packet
165
   * \brief Send a packet
161
   * \param p packet
166
   * \param p packet
162
   * \returns 0 on success, -1 on failure
167
   * \returns 0 on success, -1 on failure

Return to bug 1833