summaryrefslogtreecommitdiffhomepage
path: root/table/message.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-03-20 22:10:09 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-20 22:10:09 +0900
commit9355715ea394cb232d933ca20e8365b126ae6302 (patch)
tree9b22046329a177a457b7d66dbe71a7e19fcd3649 /table/message.go
parenta307c5bc7a4cea293400e4475ea504b4e2b450f4 (diff)
peer: update pathattr for non-route-server client
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/message.go')
-rw-r--r--table/message.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/table/message.go b/table/message.go
index 12a51cf6..b19bcec2 100644
--- a/table/message.go
+++ b/table/message.go
@@ -17,6 +17,7 @@ package table
import (
"bytes"
+ "github.com/osrg/gobgp/config"
"github.com/osrg/gobgp/packet"
)
@@ -127,6 +128,16 @@ 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 createUpdateMsgFromPath(path Path, msg *bgp.BGPMessage) *bgp.BGPMessage {
rf := path.GetRouteFamily()