mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
table: flag IsWithdraw down after use
paths in Destination.knownPathList are referenced by peer's adj-rib-in when there was no policy modification applied to avoid unnecessary copy. Here in Destination.explicitWithdraw(), we are using Path.IsWithdraw as a flag to signify which path stays in knownPathList and which not. Since the paths are referenced by peer's adj-rib-in, we must flag this down after use. Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
fb6e000457
commit
ae88f88568
@@ -316,8 +316,12 @@ func (dest *Destination) explicitWithdraw() paths {
|
||||
// We have a match if the source are same.
|
||||
if path.GetSource().Equal(withdraw.GetSource()) {
|
||||
isFound = true
|
||||
// this path is referenced in peer's adj-rib-in
|
||||
// when there was no policy modification applied.
|
||||
// we sould flag IsWithdraw down after use to avoid
|
||||
// a path with IsWithdraw flag exists in adj-rib-in
|
||||
path.IsWithdraw = true
|
||||
matches = append(matches, path)
|
||||
matches = append(matches, withdraw)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,6 +339,8 @@ func (dest *Destination) explicitWithdraw() paths {
|
||||
if !path.IsWithdraw {
|
||||
newKnownPaths = append(newKnownPaths, path)
|
||||
}
|
||||
// here we flag IsWithdraw down
|
||||
path.IsWithdraw = false
|
||||
}
|
||||
|
||||
dest.knownPathList = newKnownPaths
|
||||
|
||||
Reference in New Issue
Block a user