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

AddPath capability related code path should only used when capability is present


  This code previously failed to remove and therefore withdraw routes from
  non AddPathRX capable neighbors as there could no PathID be found for them.

Signed-off-by: default avatarMaximilian Wilhelm <max@sdn.clinic>
parent 5ea15b6e
No related branches found
No related tags found
No related merge requests found
......@@ -111,14 +111,19 @@ func (a *AdjRIBOut) RemovePath(pfx bnet.Prefix, p *route.Path) bool {
}
a.rt.RemovePath(pfx, p)
pathID, err := a.pathIDManager.releasePath(p)
if err != nil {
log.Warningf("Unable to release path: %v", err)
return true
// If the neighbar has AddPath capabilities, try to find the PathID
if a.neighbor.CapAddPathRX {
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
}
p = p.Copy()
p.BGPPath.PathIdentifier = pathID
a.removePathFromClients(pfx, p)
return true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment