summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-02-29 14:46:07 +0000
committerOthmar Gsenger <otti@anytun.org>2008-02-29 14:46:07 +0000
commit42b921f09a3178d308ec9f3b3ac605fd95f26bc0 (patch)
tree71d0d2503569790d58225185c529353a83fd43f7
parentoutput route on anytun-showtables; (diff)
route
-rw-r--r--routingTable.cpp6
-rw-r--r--routingTable.h2
-rw-r--r--syncRouteCommand.h2
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_)));
};
};