From 0a9158afe44cd9d309ee5f082abce66ce3848691 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Wed, 18 Feb 2009 09:36:33 +0000 Subject: rebuild routing tree on addRoute --- src/routingTable.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routingTable.cpp b/src/routingTable.cpp index f457505..d1a21e9 100644 --- a/src/routingTable.cpp +++ b/src/routingTable.cpp @@ -102,7 +102,10 @@ void RoutingTable::addRoute(const NetworkPrefix & pref, u_int16_t mux) routes_[pref.getNetworkAddressType()].erase(ret.first); routes_[pref.getNetworkAddressType()].insert(RoutingMap::value_type(pref,mux)); } - updateRouteTreeUnlocked(pref); + root_[pref.getNetworkAddressType()]=RoutingTreeNode(); + RoutingMap::iterator it = routes_[type].begin(); + for (;it!=routes_[pref.getNetworkAddressType()].end();++it) + updateRouteTreeUnlocked(it->first); } else if (type==ethernet) { return; // TODO: add support for ethernet } else { -- cgit v1.2.3