From 9471e3121f5a747d3736c22f9dff3f71aa273dda Mon Sep 17 00:00:00 2001 From: Lalith Suresh Date: Wed, 16 Feb 2011 19:09:58 +0000 Subject: [PATCH] Bug 1052 - olsr::RoutingProtocol::LinkTupleUpdated incorrect detection of asymmetric link with multiple interface node --- .../olsr/model/olsr-routing-protocol.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/routing/olsr/model/olsr-routing-protocol.cc b/src/routing/olsr/model/olsr-routing-protocol.cc index ca9ac2d38..dd6290937 100644 --- a/src/routing/olsr/model/olsr-routing-protocol.cc +++ b/src/routing/olsr/model/olsr-routing-protocol.cc @@ -2450,7 +2450,23 @@ RoutingProtocol::LinkTupleUpdated (const LinkTuple &tuple, uint8_t willingness) #ifdef NS3_LOG_ENABLE int statusBefore = nb_tuple->status; #endif // NS3_LOG_ENABLE - if (tuple.symTime >= Simulator::Now ()) + + bool hasSymmetricLink = false; + + const LinkSet &linkSet = m_state.GetLinks (); + for (LinkSet::const_iterator it = linkSet.begin(); + it != linkSet.end(); it++) + { + const LinkTuple &link_tuple = *it; + if (GetMainAddress (link_tuple.neighborIfaceAddr) == nb_tuple->neighborMainAddr + && link_tuple.symTime >= Simulator::Now ()) + { + hasSymmetricLink = true; + break; + } + } + + if (hasSymmetricLink) { nb_tuple->status = NeighborTuple::STATUS_SYM; NS_LOG_DEBUG (*nb_tuple << "->status = STATUS_SYM; changed:"