summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-04 11:51:31 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-01-04 13:11:07 +0900
commit11c77a200330d28a0bdba425b5b42507a7dc19b3 (patch)
treea81b5c0150c6478ccd47ac3559e5c9201cf85e07
parentb976eb7d2fbd44dff0ee84bae0d6fce772dd6441 (diff)
gobgpd: die when grpc server failed to listen
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--gobgpd/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go
index 204a068b..110718ef 100644
--- a/gobgpd/main.go
+++ b/gobgpd/main.go
@@ -169,7 +169,11 @@ func main() {
// start grpc Server
grpcServer := server.NewGrpcServer(opts.GrpcPort, bgpServer.GrpcReqCh)
- go grpcServer.Serve()
+ go func() {
+ if err := grpcServer.Serve(); err != nil {
+ log.Fatalf("failed to listen grpc port: %s", err)
+ }
+ }()
var bgpConfig *config.Bgp = nil
var policyConfig *config.RoutingPolicy = nil