Skip to content
Snippets Groups Projects
Commit f08419ab authored by Maximilian Wilhelm's avatar Maximilian Wilhelm
Browse files

Fix counting bug in RoutingTable when removing paths or prefixes.

parent 10fbe25d
Branches
Tags
No related merge requests found
......@@ -71,13 +71,13 @@ func (rt *RoutingTable) RemovePath(pfx net.Prefix, p *route.Path) {
rt.mu.Lock()
defer rt.mu.Unlock()
if rt.removePath(pfx, p) {
atomic.AddInt64(&rt.routeCount, -1)
}
rt.removePath(pfx, p)
}
func (rt *RoutingTable) removePath(pfx net.Prefix, p *route.Path) bool {
return rt.root.removePath(pfx, p)
func (rt *RoutingTable) removePath(pfx net.Prefix, p *route.Path) {
if rt.root.removePath(pfx, p) {
atomic.AddInt64(&rt.routeCount, -1)
}
}
func (rt *RoutingTable) removePaths(pfx net.Prefix, paths []*route.Path) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment