summaryrefslogtreecommitdiffhomepage
path: root/api/grpc_server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-07-29 16:28:31 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-07-29 16:31:35 +0900
commitbb15c18402ffcb5beb60aa61cfdc57577633f234 (patch)
tree39d2a646dee0cd4b031b30b0384b52911647d86b /api/grpc_server.go
parent7e74c11fdd07c0b48b81ced78178cc6e7fe3c296 (diff)
api/cli: add LocalAddress to PeerConf struct
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r--api/grpc_server.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go
index 37841ff9..875ce687 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -100,6 +100,10 @@ func (s *Server) GetNeighbor(ctx context.Context, arg *GetNeighborRequest) (*Get
timer := pconf.Timers
s := pconf.State
+ localAddress := pconf.Transport.Config.LocalAddress
+ if pconf.Transport.State.LocalAddress != "" {
+ localAddress = pconf.Transport.State.LocalAddress
+ }
return &Peer{
Conf: &PeerConf{
NeighborAddress: pconf.Config.NeighborAddress,
@@ -116,6 +120,7 @@ func (s *Server) GetNeighbor(ctx context.Context, arg *GetNeighborRequest) (*Get
RemoteCap: s.Capabilities.RemoteList,
LocalCap: s.Capabilities.LocalList,
PrefixLimits: prefixLimits,
+ LocalAddress: localAddress,
},
Info: &PeerState{
BgpState: bgp.FSMState(s.SessionState.ToInt()).String(),