summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go3
-rw-r--r--table/path.go6
2 files changed, 5 insertions, 4 deletions
diff --git a/server/peer.go b/server/peer.go
index ed4d1ae4..cf9c183d 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -271,8 +271,7 @@ func (peer *Peer) filterpath(path, old *table.Path) *table.Path {
return nil
}
- path = path.Clone(path.IsWithdraw)
- path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf, peer.fsm.peerInfo)
+ path = table.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf, peer.fsm.peerInfo, path)
options := &table.PolicyOptions{
Info: peer.fsm.peerInfo,
diff --git a/table/path.go b/table/path.go
index b8db56a7..89c32a16 100644
--- a/table/path.go
+++ b/table/path.go
@@ -163,10 +163,11 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath {
return bgp.NewPathAttributeAsPath(newASparams)
}
-func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor, info *PeerInfo) {
+func UpdatePathAttrs(global *config.Global, peer *config.Neighbor, info *PeerInfo, original *Path) *Path {
if peer.RouteServer.Config.RouteServerClient {
- return
+ return original
}
+ path := original.Clone(original.IsWithdraw)
for _, a := range path.GetPathAttrs() {
if _, y := bgp.PathAttrFlags[a.GetType()]; !y {
@@ -257,6 +258,7 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor,
"Key": peer.Config.NeighborAddress,
}).Warnf("invalid peer type: %d", peer.State.PeerType)
}
+ return path
}
func (path *Path) GetTimestamp() time.Time {