diff --git a/src/routing/olsr/olsr-agent-impl.cc b/src/routing/olsr/olsr-agent-impl.cc index 5d44ab5ec..f43b96a39 100644 --- a/src/routing/olsr/olsr-agent-impl.cc +++ b/src/routing/olsr/olsr-agent-impl.cc @@ -422,7 +422,7 @@ OlsrAgentImpl::MprComputation() { TwoHopNeighborTuple const &twoHopNeigh = *it; bool ok = true; - NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple (twoHopNeigh.neighborMainAddr); + const NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple (twoHopNeigh.neighborMainAddr); if (nb_tuple == NULL) { ok = false; @@ -711,7 +711,7 @@ OlsrAgentImpl::RoutingTableComputation () { TwoHopNeighborTuple const &nb2hop_tuple = *it; bool ok = true; - NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple + const NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple (nb2hop_tuple.neighborMainAddr); if (nb_tuple == NULL) ok = false; diff --git a/src/routing/olsr/olsr-state.cc b/src/routing/olsr/olsr-state.cc index d4deaf172..e0a1aa67d 100644 --- a/src/routing/olsr/olsr-state.cc +++ b/src/routing/olsr/olsr-state.cc @@ -94,10 +94,10 @@ OlsrState::FindNeighborTuple (Ipv4Address const &mainAddr) return NULL; } -NeighborTuple* -OlsrState::FindSymNeighborTuple (Ipv4Address const &mainAddr) +const NeighborTuple* +OlsrState::FindSymNeighborTuple (Ipv4Address const &mainAddr) const { - for (NeighborSet::iterator it = m_neighborSet.begin (); + for (NeighborSet::const_iterator it = m_neighborSet.begin (); it != m_neighborSet.end (); it++) { if (it->neighborMainAddr == mainAddr && it->status == NeighborTuple::STATUS_SYM) diff --git a/src/routing/olsr/olsr-state.h b/src/routing/olsr/olsr-state.h index ad2c735fe..836d59c07 100644 --- a/src/routing/olsr/olsr-state.h +++ b/src/routing/olsr/olsr-state.h @@ -64,7 +64,7 @@ public: return m_neighborSet; } NeighborTuple* FindNeighborTuple (const Ipv4Address &mainAddr); - NeighborTuple* FindSymNeighborTuple (const Ipv4Address &mainAddr); + const NeighborTuple* FindSymNeighborTuple (const Ipv4Address &mainAddr) const; NeighborTuple* FindNeighborTuple (const Ipv4Address &mainAddr, uint8_t willingness); void EraseNeighborTuple (const NeighborTuple &neighborTuple);