summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-02-18 13:19:55 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-02-18 13:19:55 +0900
commit61890751e12a39dadc0ef072463a71c01704eaf1 (patch)
treeefbfa1e3985624e28f1ffb1e9777c9a30f5b3fb2
parent6de16dc885ebfeffb9ff3470805980f6fac579c5 (diff)
server: avoid accessing to globalRib before its initialization
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go
index ba30f578..c665e627 100644
--- a/server/server.go
+++ b/server/server.go
@@ -2323,7 +2323,7 @@ func (s *BgpServer) Watch(opts ...WatchOption) (w *Watcher) {
w.notify(createWatchEventPeerState(peer))
}
}
- if w.opts.initBest {
+ if w.opts.initBest && s.active() == nil {
w.notify(&WatchEventBestPath{
PathList: s.globalRib.GetBestPathList(table.GLOBAL_RIB_NAME, nil),
MultiPathList: s.globalRib.GetBestMultiPathList(table.GLOBAL_RIB_NAME, nil),
@@ -2370,7 +2370,7 @@ func (s *BgpServer) Watch(opts ...WatchOption) (w *Watcher) {
}
}
}
- if w.opts.initPostUpdate {
+ if w.opts.initPostUpdate && s.active() == nil {
for _, rf := range s.globalRib.GetRFlist() {
if len(s.globalRib.Tables[rf].GetDestinations()) == 0 {
continue