From 6f8db811e0958acda8dd1ea31028083abfd597e0 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 31 Mar 2015 08:56:49 +0000 Subject: server: clone paths before storing to adj-rib-out Signed-off-by: ISHIDA Wataru --- table/message.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'table/message.go') 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 { -- cgit v1.2.3