diff options
author | Chris Stockton <cstockton@godaddy.com> | 2016-11-21 11:18:53 -0700 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-11-23 05:43:57 -0800 |
commit | 38c47609a2eeae67c2c9cc042adea60484c2f481 (patch) | |
tree | 0e8166d9d612d67b4e2f741883cd6a136808cec5 /api/grpc_server.go | |
parent | 5d4e9154b063aee1ecc1a90212965b561c6def99 (diff) |
api: Update the grpc server to accept the local address and remote port from the transport config
This allows using the gobgp/client to send a transport config with a port number.
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r-- | api/grpc_server.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index f445ab3a..51a80bff 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -190,6 +190,10 @@ func NewPeerFromConfigStruct(pconf *config.Neighbor) *Peer { RouteServer: &RouteServer{ RouteServerClient: pconf.RouteServer.Config.RouteServerClient, }, + Transport: &Transport{ + RemotePort: uint32(pconf.Transport.Config.RemotePort), + LocalAddress: pconf.Transport.Config.LocalAddress, + }, } } @@ -893,6 +897,7 @@ func NewNeighborFromAPIStruct(a *Peer) (*config.Neighbor, error) { if a.Transport != nil { pconf.Transport.Config.LocalAddress = a.Transport.LocalAddress pconf.Transport.Config.PassiveMode = a.Transport.PassiveMode + pconf.Transport.Config.RemotePort = uint16(a.Transport.RemotePort) } if a.EbgpMultihop != nil { pconf.EbgpMultihop.Config.Enabled = a.EbgpMultihop.Enabled |