From 42b921f09a3178d308ec9f3b3ac605fd95f26bc0 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Fri, 29 Feb 2008 14:46:07 +0000 Subject: route --- routingTable.cpp | 6 +++--- routingTable.h | 2 +- syncRouteCommand.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routingTable.cpp b/routingTable.cpp index 2cc9e3e..8ed5697 100644 --- a/routingTable.cpp +++ b/routingTable.cpp @@ -91,15 +91,15 @@ u_int16_t RoutingTable::getRoute(const NetworkAddress & addr) return 0; } -u_int16_t& RoutingTable::getOrNewRoutingTEUnlocked(const NetworkAddress & addr) +u_int16_t* RoutingTable::getOrNewRoutingTEUnlocked(const NetworkAddress & addr) { RoutingMap::iterator it = routes_.find(addr); if(it!=routes_.end()) - return it->second; + return &(it->second); routes_.insert(RoutingMap::value_type(addr, 1)); it = routes_.find(addr); - return it->second; + return &(it->second); } uint16_t RoutingTable::getCountUnlocked() diff --git a/routingTable.h b/routingTable.h index a277678..6ffd15b 100644 --- a/routingTable.h +++ b/routingTable.h @@ -53,7 +53,7 @@ public: bool empty(); void clear(); Mutex& getMutex(); - u_int16_t& getOrNewRoutingTEUnlocked(const NetworkAddress & addr); + u_int16_t* getOrNewRoutingTEUnlocked(const NetworkAddress & addr); uint16_t getCountUnlocked(); RoutingMap::iterator getBeginUnlocked(); RoutingMap::iterator getEndUnlocked(); diff --git a/syncRouteCommand.h b/syncRouteCommand.h index fa66322..e8d1550 100644 --- a/syncRouteCommand.h +++ b/syncRouteCommand.h @@ -26,7 +26,7 @@ private: ar & addr_; // u_int16_t & mux (gRoutingTable.getOrNewRoutingTEUnlocked(addr_)); // ar & mux; - ar & gRoutingTable.getOrNewRoutingTEUnlocked(addr_); + ar & (*(gRoutingTable.getOrNewRoutingTEUnlocked(addr_))); }; }; -- cgit v1.2.3