summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go
index bb208846..03b9cbd2 100644
--- a/server/server.go
+++ b/server/server.go
@@ -1144,6 +1144,10 @@ func (s *BgpServer) Shutdown() {
for _, p := range s.neighborMap {
p.fsm.adminStateCh <- stateOp
}
+ // the main goroutine waits for peers' goroutines to stop but if no peer is configured, needs to die immediately.
+ if len(s.neighborMap) == 0 {
+ os.Exit(0)
+ }
// TODO: call fsmincomingCh.Close()
return nil
}, false)