From 38c47609a2eeae67c2c9cc042adea60484c2f481 Mon Sep 17 00:00:00 2001 From: Chris Stockton Date: Mon, 21 Nov 2016 11:18:53 -0700 Subject: 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. --- api/grpc_server.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/grpc_server.go') 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 -- cgit v1.2.3