summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go8
-rw-r--r--table/path.go7
2 files changed, 11 insertions, 4 deletions
diff --git a/server/peer.go b/server/peer.go
index 966f77d3..62716e4c 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -152,10 +152,10 @@ func (peer *Peer) filterpath(path *table.Path) *table.Path {
if filterpath(peer, path) == nil {
return nil
}
- if !peer.isRouteServerClient() {
- path = path.Clone(path.IsWithdraw)
- path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf)
- }
+
+ path = path.Clone(path.IsWithdraw)
+ path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf)
+
options := &table.PolicyOptions{
Info: peer.fsm.peerInfo,
}
diff --git a/table/path.go b/table/path.go
index d4946e8d..1d0765d4 100644
--- a/table/path.go
+++ b/table/path.go
@@ -160,6 +160,13 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath {
}
func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) {
+ for _, a := range path.GetPathAttrs() {
+ if _, y := bgp.PathAttrFlags[a.GetType()]; !y {
+ if a.GetFlags()&bgp.BGP_ATTR_FLAG_TRANSITIVE == 0 {
+ path.delPathAttr(a.GetType())
+ }
+ }
+ }
if peer.RouteServer.Config.RouteServerClient {
return