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

Cleanup

parent 93f767c6
No related branches found
No related tags found
No related merge requests found
...@@ -138,28 +138,30 @@ func (a *AdjRIBOut) RemovePath(pfx bnet.Prefix, p *route.Path) bool { ...@@ -138,28 +138,30 @@ func (a *AdjRIBOut) RemovePath(pfx bnet.Prefix, p *route.Path) bool {
return false return false
} }
q := p sentPath := p
if a.addPathTX { if a.addPathTX {
for _, q := range r.Paths() { for _, sentPath := range r.Paths() {
if q.Select(p) == 0 { if sentPath.Select(p) != 0 {
a.rt.RemovePath(pfx, q) continue
// 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
} }
a.rt.RemovePath(pfx, sentPath)
_, err := a.pathIDManager.releasePath(p)
if err != nil {
log.Warningf("Unable to release path for prefix %s: %v", pfx.String(), err)
return true
}
}
if sentPath == p {
return false
} }
} else { } else {
a.rt.RemovePath(pfx, p) a.rt.RemovePath(pfx, p)
} }
a.removePathFromClients(pfx, q) a.removePathFromClients(pfx, sentPath)
return true return true
} }
......
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