Skip to content

Commit

Permalink
Merge pull request #249 from bio-routing/fix/addPathTX
Browse files Browse the repository at this point in the history
Fix route withdraw when using BGP add path TX
  • Loading branch information
awlx authored Mar 3, 2020
2 parents 9be746a + ed30b51 commit edd93f3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions routingtable/adjRIBOut/adj_rib_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,20 @@ func (a *AdjRIBOut) removePath(pfx *bnet.Prefix, p *route.Path) bool {

sentPath := p
if a.addPathTX {
for _, sentPath := range r.Paths() {
if sentPath.Select(p) != 0 {
continue
for _, sp := range r.Paths() {
if sp.Select(p) == 0 {
a.rt.RemovePath(pfx, sp)

_, err := a.pathIDManager.releasePath(p)
if err != nil {
log.Warningf("Unable to release path for prefix %s: %v", pfx.String(), err)
return true
}

sentPath = sp
break
}

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 {
Expand Down

0 comments on commit edd93f3

Please sign in to comment.