summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-21 11:49:00 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-23 09:46:53 +0900
commitc5fae01b021924295f38ad4ab3a34e9f960d0200 (patch)
tree77c4f8847d6c5a14c769b2db3608e8c50f42788d
parenta4c2ea3d18fcada66a1199ee7e17b30a0479f72b (diff)
vrf: fix rtc withdraw handling
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/server.go9
-rw-r--r--table/table.go6
2 files changed, 10 insertions, 5 deletions
diff --git a/server/server.go b/server/server.go
index 9761fc28..97f9228c 100644
--- a/server/server.go
+++ b/server/server.go
@@ -683,12 +683,19 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) ([]
for _, p := range candidates {
for _, ext := range p.GetExtCommunities() {
if ext.String() == rt.String() {
+ if path.IsWithdraw {
+ p = p.Clone(true)
+ }
paths = append(paths, p)
break
}
}
}
- paths = peer.processOutgoingPaths(paths, nil)
+ if path.IsWithdraw {
+ paths = peer.processOutgoingPaths(nil, paths)
+ } else {
+ paths = peer.processOutgoingPaths(paths, nil)
+ }
msgs = append(msgs, newSenderMsg(peer, paths, nil, false))
}
}
diff --git a/table/table.go b/table/table.go
index 50cecc58..cbe5c4c9 100644
--- a/table/table.go
+++ b/table/table.go
@@ -86,8 +86,7 @@ func (t *Table) deletePathsByVrf(vrf *Vrf) []*Path {
return pathList
}
if p.IsLocal() && vrf.Rd.String() == rd.String() {
- p.IsWithdraw = true
- pathList = append(pathList, p)
+ pathList = append(pathList, p.Clone(true))
break
}
}
@@ -108,8 +107,7 @@ func (t *Table) deleteRTCPathsByVrf(vrf *Vrf, vrfs map[string]*Vrf) []*Path {
if lhs == rhs && isLastTargetUser(vrfs, target) {
for _, p := range dest.knownPathList {
if p.IsLocal() {
- p.IsWithdraw = true
- pathList = append(pathList, p)
+ pathList = append(pathList, p.Clone(true))
break
}
}