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

(-)a/src/internet/model/tcp-socket-base.cc (-4 / +17 lines)
 Lines 651-671    Link Here 
651
{
651
{
652
  NS_LOG_FUNCTION (netdevice);
652
  NS_LOG_FUNCTION (netdevice);
653
  Socket::BindToNetDevice (netdevice); // Includes sanity check
653
  Socket::BindToNetDevice (netdevice); // Includes sanity check
654
  if (m_endPoint == 0 && m_endPoint6 == 0)
654
  if (m_endPoint == 0)
655
    {
655
    {
656
      if (Bind () == -1)
656
      if (Bind () == -1)
657
        {
657
        {
658
          NS_ASSERT ((m_endPoint == 0 && m_endPoint6 == 0));
658
          NS_ASSERT (m_endPoint == 0);
659
          return;
659
          return;
660
        }
660
        }
661
      NS_ASSERT ((m_endPoint != 0 && m_endPoint6 != 0));
661
      NS_ASSERT (m_endPoint != 0);
662
    }
663
664
  if (m_endPoint6 == 0)
665
    {
666
      if (Bind6 () == -1)
667
        {
668
          NS_ASSERT (m_endPoint6 == 0);
669
          return;
670
        }
671
      NS_ASSERT (m_endPoint6 != 0);
662
    }
672
    }
663
673
664
  if (m_endPoint != 0)
674
  if (m_endPoint != 0)
665
    {
675
    {
666
      m_endPoint->BindToNetDevice (netdevice);
676
      m_endPoint->BindToNetDevice (netdevice);
667
    }
677
    }
668
  // No BindToNetDevice() for Ipv6EndPoint
678
  if (m_endPoint6 != 0)
679
    {
680
      m_endPoint6->BindToNetDevice (netdevice);
681
    }
669
  return;
682
  return;
670
}
683
}
671
684
(-)a/src/internet/model/udp-socket-impl.cc (+16 lines)
 Lines 229-234    Link Here 
229
229
230
  if (InetSocketAddress::IsMatchingType (address))
230
  if (InetSocketAddress::IsMatchingType (address))
231
    {
231
    {
232
      NS_ASSERT_MSG (m_endPoint == 0, "Endpoint already allocated.");
233
232
      InetSocketAddress transport = InetSocketAddress::ConvertFrom (address);
234
      InetSocketAddress transport = InetSocketAddress::ConvertFrom (address);
233
      Ipv4Address ipv4 = transport.GetIpv4 ();
235
      Ipv4Address ipv4 = transport.GetIpv4 ();
234
      uint16_t port = transport.GetPort ();
236
      uint16_t port = transport.GetPort ();
 Lines 256-261    Link Here 
256
    }
258
    }
257
  else if (Inet6SocketAddress::IsMatchingType (address))
259
  else if (Inet6SocketAddress::IsMatchingType (address))
258
    {
260
    {
261
      NS_ASSERT_MSG (m_endPoint == 0, "Endpoint already allocated.");
262
259
      Inet6SocketAddress transport = Inet6SocketAddress::ConvertFrom (address);
263
      Inet6SocketAddress transport = Inet6SocketAddress::ConvertFrom (address);
260
      Ipv6Address ipv6 = transport.GetIpv6 ();
264
      Ipv6Address ipv6 = transport.GetIpv6 ();
261
      uint16_t port = transport.GetPort ();
265
      uint16_t port = transport.GetPort ();
 Lines 894-899    Link Here 
894
UdpSocketImpl::BindToNetDevice (Ptr<NetDevice> netdevice)
898
UdpSocketImpl::BindToNetDevice (Ptr<NetDevice> netdevice)
895
{
899
{
896
  NS_LOG_FUNCTION (netdevice);
900
  NS_LOG_FUNCTION (netdevice);
901
897
  Socket::BindToNetDevice (netdevice); // Includes sanity check
902
  Socket::BindToNetDevice (netdevice); // Includes sanity check
898
  if (m_endPoint == 0)
903
  if (m_endPoint == 0)
899
    {
904
    {
 Lines 905-910    Link Here 
905
      NS_ASSERT (m_endPoint != 0);
910
      NS_ASSERT (m_endPoint != 0);
906
    }
911
    }
907
  m_endPoint->BindToNetDevice (netdevice);
912
  m_endPoint->BindToNetDevice (netdevice);
913
914
  if (m_endPoint6 == 0)
915
    {
916
      if (Bind6 () == -1)
917
        {
918
          NS_ASSERT (m_endPoint6 == 0);
919
          return;
920
        }
921
      NS_ASSERT (m_endPoint6 != 0);
922
    }
923
  m_endPoint6->BindToNetDevice (netdevice);
908
  return;
924
  return;
909
}
925
}
910
926

Return to bug 1824