diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-13 20:41:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-13 20:41:40 +0900 |
commit | b8f83f8edebb1d53e2b1ebbb6cb8350f6f94a56d (patch) | |
tree | 7ffcf848c45c7ecd11747f5bab2df58cb5697c4d | |
parent | c8d69a3906dc9a6ea9a7257805fbb7682362c367 (diff) |
drop unknown optional non-transitive attributes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | server/peer.go | 8 | ||||
-rw-r--r-- | table/path.go | 7 |
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 |