diff options
author | ksang <kaitoy@qq.com> | 2017-01-13 17:34:20 +0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-01-16 04:18:16 -0800 |
commit | b43326b2e3cfa4a63ac77c5ad05842a225948b6f (patch) | |
tree | 477d5de25cb5f6132c67236da6bcc6c4218d45ba /server/server.go | |
parent | 3f34af3dc917e53863789ca10f180dc1c403291b (diff) |
GetVrf() cause bgpd panic if it is not started
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 5 |
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()) |