diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-09-16 09:45:24 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-09-16 09:45:24 +0000 |
commit | c790472dad116de02fc9471147bb9efa85db75d0 (patch) | |
tree | d9a17824339f8bf6fe87fc617b9dcd0897b4f63e /table | |
parent | 0db1cd4af26a2c5025517ae30c9c16b11d5bb8d6 (diff) |
server/table: don't modify/delete path attributes for route server client
RFC7947 2.2 says
Optional recognized and unrecognized BGP attributes, whether transitive
or non-transitive, SHOULD NOT be updated by the route server
(unless enforced by local IXP operator configuration) and SHOULD be passed
on to other route server clients
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/path.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/table/path.go b/table/path.go index 0aab6004..b07c01e1 100644 --- a/table/path.go +++ b/table/path.go @@ -160,6 +160,10 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath { } func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) { + if peer.RouteServer.Config.RouteServerClient { + return + } + for _, a := range path.GetPathAttrs() { if _, y := bgp.PathAttrFlags[a.GetType()]; !y { if a.GetFlags()&bgp.BGP_ATTR_FLAG_TRANSITIVE == 0 { @@ -168,10 +172,6 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) } } - if peer.RouteServer.Config.RouteServerClient { - return - } - localAddress := net.ParseIP(peer.Transport.State.LocalAddress) isZero := func(ip net.IP) bool { return ip.Equal(net.ParseIP("0.0.0.0")) || ip.Equal(net.ParseIP("::")) |