Backed out changeset 055ff23aa034 (Tom does not like it turns out OLSR does not need it)
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Sun Feb 03 18:29:25 2008 +0000 (2008-02-03)
changeset 2305518187ed457c
parent 2300 055ff23aa034
child 2306 6f947d8c8f41
Backed out changeset 055ff23aa034 (Tom does not like it turns out OLSR does not need it)
src/internet-node/udp-socket.cc
     1.1 --- a/src/internet-node/udp-socket.cc	Fri Feb 01 19:29:56 2008 +0000
     1.2 +++ b/src/internet-node/udp-socket.cc	Sun Feb 03 18:29:25 2008 +0000
     1.3 @@ -282,22 +282,9 @@
     1.4            Ipv4Address addri = ipv4->GetAddress (i);
     1.5            Ipv4Mask maski = ipv4->GetNetworkMask (i);
     1.6            Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski);
     1.7 -          Ipv4Address saddr;
     1.8 -
     1.9 -          if (m_endPoint->GetLocalAddress () == Ipv4Address::GetAny ())
    1.10 -            {
    1.11 -              // source address = interface address
    1.12 -              saddr = addri;
    1.13 -            }
    1.14 -          else
    1.15 -            {
    1.16 -              // Bind was called on the socket to set an address; use it
    1.17 -              saddr = m_endPoint->GetLocalAddress ();
    1.18 -            }
    1.19 -          
    1.20 -          NS_LOG_LOGIC ("Sending one copy from " << saddr << " to " << bcast
    1.21 +          NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << bcast
    1.22                          << " (mask is " << maski << ")");
    1.23 -          m_udp->Send (p->Copy (), saddr, bcast,
    1.24 +          m_udp->Send (p->Copy (), addri, bcast,
    1.25                         m_endPoint->GetLocalPort (), port);
    1.26            NotifyDataSent (p->GetSize ());
    1.27          }
    1.28 @@ -305,21 +292,8 @@
    1.29      }
    1.30    else if (ipv4->GetIfIndexForDestination(dest, localIfIndex))
    1.31      {
    1.32 -      Ipv4Address saddr;
    1.33 -
    1.34 -      if (m_endPoint->GetLocalAddress () == Ipv4Address::GetAny ())
    1.35 -        {
    1.36 -          // source address = interface address
    1.37 -          saddr = ipv4->GetAddress (localIfIndex);
    1.38 -        }
    1.39 -      else
    1.40 -        {
    1.41 -          // Bind was called on the socket to set an address; use it
    1.42 -          saddr = m_endPoint->GetLocalAddress ();
    1.43 -        }
    1.44 -
    1.45        NS_LOG_LOGIC ("Route exists");
    1.46 -      m_udp->Send (p, saddr, dest,
    1.47 +      m_udp->Send (p, ipv4->GetAddress (localIfIndex), dest,
    1.48  		   m_endPoint->GetLocalPort (), port);
    1.49        NotifyDataSent (p->GetSize ());
    1.50        return 0;