Default TTL of IPv4 broadcast datagrams changed from 1 to 64
authorPavel Boyko <boyko@iitp.ru>
Sat, 14 Nov 2009 08:48:35 -0800
changeset 5529 58b1b656d536
parent 5528 9d076609fc80
child 5530 e5e73d83bec3
Default TTL of IPv4 broadcast datagrams changed from 1 to 64
CHANGES.html
src/internet-stack/ipv4-l3-protocol.cc
--- a/CHANGES.html	Sat Nov 14 07:13:06 2009 -0800
+++ b/CHANGES.html	Sat Nov 14 08:48:35 2009 -0800
@@ -60,6 +60,9 @@
 <li><b>Object::DoStart</b>: Users who need to complete their object setup at the start of a simulation
 can override this virtual method, perform their adhoc setup, and then, must chain up to their parent.
 </ul>
+<ul>
+<li> Default TTL of IPv4 broadcast datagrams changed from 1 to 64.
+</ul> 
 
 <h2>Changes to existing API:</h2>
 <ul>
--- a/src/internet-stack/ipv4-l3-protocol.cc	Sat Nov 14 07:13:06 2009 -0800
+++ b/src/internet-stack/ipv4-l3-protocol.cc	Sat Nov 14 08:48:35 2009 -0800
@@ -406,6 +406,7 @@
 
   for (SocketList::iterator i = m_sockets.begin (); i != m_sockets.end (); ++i)
     {
+      NS_LOG_LOGIC ("Forwarding to raw socket"); 
       Ptr<Ipv4RawSocketImpl> socket = *i;
       socket->ForwardUp (packet, ipHeader, device);
     }
@@ -469,7 +470,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 ();
@@ -502,7 +502,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 ();
               m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex);