Do not set ttl = 1 for broadcasts
authorPavel Boyko <boyko@iitp.ru>
Wed, 19 Aug 2009 12:19:04 +0400
changeset 5691 28cd8aae2d7a
parent 5690 22dd676f5986
child 5693 7ace8dc7303c
Do not set ttl = 1 for broadcasts
src/internet-stack/ipv4-l3-protocol.cc
--- a/src/internet-stack/ipv4-l3-protocol.cc	Wed Aug 19 10:34:32 2009 +0400
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Wed Aug 19 12:19:04 2009 +0400
@@ -468,7 +468,6 @@
   if (destination.IsBroadcast ()) 
     {
       NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 1:  limited broadcast");
-      ttl = 1;
       ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
       uint32_t ifaceIndex = 0;
       for (Ipv4InterfaceList::iterator ifaceIter = m_interfaces.begin ();
@@ -499,7 +498,6 @@
               destination.CombineMask (ifAddr.GetMask ()) == ifAddr.GetLocal ().CombineMask (ifAddr.GetMask ())   )  
             {
               NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 2:  subnet directed bcast to " << ifAddr.GetLocal ());
-              ttl = 1;
               ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
               Ptr<Packet> packetCopy = packet->Copy ();
               packetCopy->AddHeader (ipHeader);