summaryrefslogtreecommitdiff
path: root/src/routingTable.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2009-02-18 09:36:33 +0000
committerOthmar Gsenger <otti@anytun.org>2009-02-18 09:36:33 +0000
commit0a9158afe44cd9d309ee5f082abce66ce3848691 (patch)
treec73e0e35c263d2d98300ac960cbb83e5da6112b8 /src/routingTable.cpp
parentturn off routing, when no multi connection support (no sync hosts or tap device) (diff)
rebuild routing tree on addRoute
Diffstat (limited to 'src/routingTable.cpp')
-rw-r--r--src/routingTable.cpp5
1 files changed, 4 insertions, 1 deletions
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 {