UpdateRouteToNeighbor changed to take into account case, when route to node exists in routing table with hop count != 1
authorBorovkova Elena <borovkovaes@iitp.ru>
Thu, 13 Aug 2009 17:30:28 +0400
changeset 5657 5983e16013d9
parent 5656 a50bf07ed462
child 5658 b4e2a9fa80dc
UpdateRouteToNeighbor changed to take into account case, when route to node exists in routing table with hop count != 1
src/routing/aodv/aodv-routing-protocol.cc
--- a/src/routing/aodv/aodv-routing-protocol.cc	Thu Aug 13 17:16:38 2009 +0400
+++ b/src/routing/aodv/aodv-routing-protocol.cc	Thu Aug 13 17:30:28 2009 +0400
@@ -626,15 +626,17 @@
     {
       Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver));
       RoutingTableEntry newEntry (/*device=*/dev, /*dst=*/sender, /*know seqno=*/false, /*seqno=*/0,
-                                  /*iface=*/m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0),
-                                  /*hops=*/1, /*next hop=*/sender, /*lifetime=*/ActiveRouteTimeout);
+      /*iface=*/m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0),
+      /*hops=*/1, /*next hop=*/sender, /*lifetime=*/ActiveRouteTimeout);
       m_routingTable.AddRoute (newEntry);
     }
   else
     {
-      toNeighbor.SetFlag (RTF_UP);
-      toNeighbor.SetLifeTime (std::max (ActiveRouteTimeout, toNeighbor.GetLifeTime ()));
-      m_routingTable.Update (toNeighbor);
+      Ptr<NetDevice> dev = m_ipv4->GetNetDevice (m_ipv4->GetInterfaceForAddress (receiver));
+      RoutingTableEntry newEntry (/*device=*/dev, /*dst=*/sender, /*know seqno=*/false, /*seqno=*/0,
+      /*iface=*/m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress (receiver), 0),
+      /*hops=*/1, /*next hop=*/sender, /*lifetime=*/std::max (ActiveRouteTimeout, toNeighbor.GetLifeTime ()));
+      m_routingTable.Update (newEntry);
     }
 }