diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-31 08:56:49 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-04-04 21:50:50 +0900 |
commit | 6f8db811e0958acda8dd1ea31028083abfd597e0 (patch) | |
tree | 53d365db30a8a2ea604ba325df1dd9384a333704 /table/message.go | |
parent | ef65699c8c8bfc2b0177a645ea9e12df097285ab (diff) |
server: clone paths before storing to adj-rib-out
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/message.go')
-rw-r--r-- | table/message.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/table/message.go b/table/message.go index 7c290780..502dbd4c 100644 --- a/table/message.go +++ b/table/message.go @@ -128,14 +128,8 @@ func cloneAttrSlice(attrs []bgp.PathAttributeInterface) []bgp.PathAttributeInter return clonedAttrs } -func CloneAndUpdatePathAttrs(pathList []Path, global *config.Global, peer *config.Neighbor) []Path { - newPathList := make([]Path, 0, len(pathList)) - for _, p := range pathList { - clone := p.Clone(p.IsWithdraw()) - clone.updatePathAttrs(global, peer) - newPathList = append(newPathList, clone) - } - return newPathList +func UpdatePathAttrs(path Path, global *config.Global, peer *config.Neighbor) { + path.updatePathAttrs(global, peer) } func createUpdateMsgFromPath(path Path, msg *bgp.BGPMessage) *bgp.BGPMessage { |