summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-26 15:26:28 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-26 07:10:38 +0900
commitae88f8856834898d876a10fa7aa51dbaba466a2c (patch)
tree2e230ca43d2ad9956ac4d53d15b2ec9042882e13 /table/destination.go
parentfb6e00045726d606d24385a6f5c23c7f2048b0a0 (diff)
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 <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/table/destination.go b/table/destination.go
index 0e195f83..7cca1b37 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -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