summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorksang <kaitoy@qq.com>2017-01-13 17:34:20 +0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-01-16 04:18:16 -0800
commitb43326b2e3cfa4a63ac77c5ad05842a225948b6f (patch)
tree477d5de25cb5f6132c67236da6bcc6c4218d45ba
parent3f34af3dc917e53863789ca10f180dc1c403291b (diff)
GetVrf() cause bgpd panic if it is not started
-rw-r--r--server/server.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/server.go b/server/server.go
index 2ab17a4e..8140252c 100644
--- a/server/server.go
+++ b/server/server.go
@@ -1256,7 +1256,10 @@ func (s *BgpServer) GetVrf() (l []*table.Vrf) {
s.mgmtCh <- func() {
defer close(ch)
-
+ if err := s.active(); err != nil {
+ log.Errorf("get vrf failed: %v", err)
+ return
+ }
l = make([]*table.Vrf, 0, len(s.globalRib.Vrfs))
for _, vrf := range s.globalRib.Vrfs {
l = append(l, vrf.Clone())