summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-03-01 08:14:50 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-03-01 08:14:50 +0900
commitac040204f8acdeb3dd2491b85e9ba1ddc1ee43de (patch)
treef7676d9b1abb7719c7f7546fcbca47ed2c9c3c55
parentd6998affcf413291fd615c88df958ea85baf481e (diff)
server: fix per-asn regression
AS in an OpenMsg is set to zero if a peer is configured via grpc. commit 0b78f57ccdf63591fd211ade0b571189e070f598 Author: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Date: Fri Feb 19 15:40:30 2016 +0900 config/server: support per-peer asn Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/server.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go
index 2a661e23..a24cea26 100644
--- a/server/server.go
+++ b/server/server.go
@@ -2295,8 +2295,12 @@ func (server *BgpServer) handleGrpcModNeighbor(grpcReq *GrpcRequest) (sMsgs []*S
pconf.NeighborAddress = a.Conf.NeighborAddress
pconf.Config.NeighborAddress = a.Conf.NeighborAddress
pconf.Config.PeerAs = a.Conf.PeerAs
- pconf.Config.LocalAs = a.Conf.LocalAs
- if pconf.Config.PeerAs != server.bgpConfig.Global.Config.As {
+ if a.Conf.LocalAs == 0 {
+ pconf.Config.LocalAs = server.bgpConfig.Global.Config.As
+ } else {
+ pconf.Config.LocalAs = a.Conf.LocalAs
+ }
+ if pconf.Config.PeerAs != pconf.Config.LocalAs {
pconf.Config.PeerType = config.PEER_TYPE_EXTERNAL
} else {
pconf.Config.PeerType = config.PEER_TYPE_INTERNAL