diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-11-12 11:28:56 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-15 12:06:46 +0900 |
commit | 14cd6c97277d6071ffab1b4b0681c4f261893ccc (patch) | |
tree | fb881ae5bc94f02128c49ac1fcb940bfb2c27575 | |
parent | 38da8bb562086d98d0a56cbe23ae1568e8a66792 (diff) |
server: ensure bmpClient is not nil when BgpServer is running
when gobgp/server used as a bgp library, current implementation can leave
bmpClient nil.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | gobgpd/main.go | 5 | ||||
-rw-r--r-- | server/server.go | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go index 8d0dcf58..de348021 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -170,11 +170,6 @@ func main() { grpcServer := server.NewGrpcServer(server.GRPC_PORT, bgpServer.GrpcReqCh) go grpcServer.Serve() - if opts.ConfigFile == "" { - bgpServer.SetBmpConfig(config.BmpServers{ - BmpServerList: []config.BmpServer{}, - }) - } var bgpConfig *config.Bgp = nil var policyConfig *config.RoutingPolicy = nil for { diff --git a/server/server.go b/server/server.go index 15e2a053..629dfeab 100644 --- a/server/server.go +++ b/server/server.go @@ -167,6 +167,9 @@ func (server *BgpServer) Serve() { } } + server.bmpClient, _ = newBMPClient(config.BmpServers{BmpServerList: []config.BmpServer{}}, server.bmpConnCh) + server.roaClient, _ = newROAClient(g.GlobalConfig.As, config.RpkiServers{}) + if g.Mrt.FileName != "" { w, err := newMrtWatcher(g.Mrt.FileName) if err != nil { |