summaryrefslogtreecommitdiffhomepage
path: root/api/grpc_server.go
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-06-13 14:04:50 +0900
committerSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-06-16 09:09:47 +0900
commitbe2524ee3e158a0d248d730f727da80bab09aed8 (patch)
treee27c107dc19f448bcfdd325f88cb27d82c406da4 /api/grpc_server.go
parent83684d5e62fb14596aabf03747a8b395543f91bb (diff)
config: Use State to get NeighborAddress instead of Config
By introducing dynamic neighbor feature, GoBGP can have dynamic neighbors, and corresponding Config.NeighboAddress can be empty. This patch sets State.NeighborAddress for all neighbors, and gets the neighbor's address from them. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r--api/grpc_server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go
index 213d32cf..c973e24b 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -862,7 +862,6 @@ func (s *Server) DeleteVrf(ctx context.Context, arg *DeleteVrfRequest) (*DeleteV
func NewNeighborFromAPIStruct(a *Peer) (*config.Neighbor, error) {
pconf := &config.Neighbor{}
if a.Conf != nil {
- pconf.Config.NeighborAddress = a.Conf.NeighborAddress
pconf.Config.PeerAs = a.Conf.PeerAs
pconf.Config.LocalAs = a.Conf.LocalAs
pconf.Config.AuthPassword = a.Conf.AuthPassword
@@ -993,6 +992,7 @@ func NewNeighborFromAPIStruct(a *Peer) (*config.Neighbor, error) {
pconf.State.AdjTable.Advertised = a.Info.Advertised
pconf.State.PeerAs = a.Info.PeerAs
pconf.State.PeerType = config.IntToPeerTypeMap[int(a.Info.PeerType)]
+ pconf.State.NeighborAddress = a.Info.NeighborAddress
if a.Info.Messages != nil {
if a.Info.Messages.Sent != nil {