summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-05-05 12:30:32 -0400
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-05-10 08:15:00 +0000
commit9b9a65d410bbf35730f4970932c7688203e096b1 (patch)
tree5a539d40d6190c20341ae7e5c4827e2c0bd532e2 /server/peer.go
parent1f053c25c423c79471fbe1d5fb6c618bb67409df (diff)
*: support replace-peer-as (aka as-override)
we use the term replace-peer-as instead of as-override since openconfig is using it. cli ``` $ gobgp n add <neighbor-addr> as <asn> replace-peer-as ``` config ``` neighbor: config: peer-as: <asn> neighbor-address: <neighbor-addr> as-path-options: config: replace-peer-as: true ``` Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index bd977b85..5e04ccf6 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -267,6 +267,11 @@ func (peer *Peer) filterpath(path, old *table.Path) *table.Path {
}
}
+ // replace-peer-as handling
+ if path != nil && !path.IsWithdraw && peer.fsm.pConf.AsPathOptions.State.ReplacePeerAs {
+ path = path.ReplaceAS(peer.fsm.pConf.Config.LocalAs, peer.fsm.pConf.Config.PeerAs)
+ }
+
if path = filterpath(peer, path, old); path == nil {
return nil
}