Skip to content
Snippets Groups Projects
Commit 93f767c6 authored by Oliver Herms's avatar Oliver Herms
Browse files

Cleanup

parent 08e44ed7
Branches
Tags
No related merge requests found
...@@ -138,29 +138,28 @@ func (a *AdjRIBOut) RemovePath(pfx bnet.Prefix, p *route.Path) bool { ...@@ -138,29 +138,28 @@ func (a *AdjRIBOut) RemovePath(pfx bnet.Prefix, p *route.Path) bool {
return false return false
} }
q := p
if a.addPathTX { if a.addPathTX {
for _, q := range r.Paths() { for _, q := range r.Paths() {
if q.Select(p) == 0 { if q.Select(p) == 0 {
a.rt.RemovePath(pfx, q) a.rt.RemovePath(pfx, q)
// try to find the PathID
pathID, err := a.pathIDManager.releasePath(p)
if err != nil {
log.Warningf("Unable to release path for prefix %s: %v", pfx.String(), err)
return true
}
p = p.Copy()
p.BGPPath.PathIdentifier = pathID
} }
} }
} else { } else {
a.rt.RemovePath(pfx, p) a.rt.RemovePath(pfx, p)
} }
// If the neighbor has AddPath capabilities, try to find the PathID a.removePathFromClients(pfx, q)
if a.addPathTX {
pathID, err := a.pathIDManager.releasePath(p)
if err != nil {
log.Warningf("Unable to release path for prefix %s: %v", pfx.String(), err)
return true
}
p = p.Copy()
p.BGPPath.PathIdentifier = pathID
}
a.removePathFromClients(pfx, p)
return true return true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment