Skip to content
Snippets Groups Projects
Commit c5ca8db0 authored by Christoph Petrausch's avatar Christoph Petrausch
Browse files

Use prefix of old route. New route could be nil.

parent ae516792
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,7 @@ func (a *LocRIB) removePathsFromClients(oldRoute *route.Route, newRoute *route.R
withdraw := route.PathsDiff(oldRoute.Paths()[0:oldPathsLimit], newRoute.Paths()[0:newPathsLimit])
for _, p := range withdraw {
client.RemovePath(newRoute.Prefix(), p)
client.RemovePath(oldRoute.Prefix(), p)
}
}
}
......@@ -130,18 +130,18 @@ func (a *LocRIB) removePathsFromClients(oldRoute *route.Route, newRoute *route.R
func (a *LocRIB) ContainsPfxPath(pfx net.Prefix, p *route.Path) bool {
a.mu.RLock()
defer a.mu.RUnlock()
r := a.rt.Get(pfx)
if r == nil {
return false
}
for _, path := range r.Paths() {
if path.Compare(p) == 0 {
return true
}
}
return false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment