diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-03-01 08:14:50 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-03-01 08:14:50 +0900 |
commit | ac040204f8acdeb3dd2491b85e9ba1ddc1ee43de (patch) | |
tree | f7676d9b1abb7719c7f7546fcbca47ed2c9c3c55 /server/server.go | |
parent | d6998affcf413291fd615c88df958ea85baf481e (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>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 8 |
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 |