From 01be08e43e0a70eee9435b9562f747051d8d1fe7 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Fri, 29 Feb 2008 20:06:16 +0000 Subject: removed debug statemet added fallback default route --- routingTable.cpp | 4 +++- syncClientSocket.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/routingTable.cpp b/routingTable.cpp index f15f857..2f8afd0 100644 --- a/routingTable.cpp +++ b/routingTable.cpp @@ -83,11 +83,13 @@ u_int16_t RoutingTable::getRoute(const NetworkAddress & addr) if (routes_.empty()) return 0; NetworkPrefix prefix(addr,32); + //TODO Routing algorithem isnt working!!! RoutingMap::iterator it = routes_.lower_bound(prefix); // it--; if (it!=routes_.end()) return it->second; - return 0; + it=routes_.begin(); + return it->second; } u_int16_t* RoutingTable::getOrNewRoutingTEUnlocked(const NetworkPrefix & addr) diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp index cf266ca..b4ed015 100644 --- a/syncClientSocket.cpp +++ b/syncClientSocket.cpp @@ -44,7 +44,7 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len) { for(size_t index=0;index