From e55c4a7d3048a44577982c76a4ffb5f4018d39b6 Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Mon, 9 Sep 2019 15:59:54 +0200 Subject: [PATCH] bird2 compatible check with protocol state --- backend/sources/birdwatcher/source_multitable.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/sources/birdwatcher/source_multitable.go b/backend/sources/birdwatcher/source_multitable.go index 93851c7..914d487 100644 --- a/backend/sources/birdwatcher/source_multitable.go +++ b/backend/sources/birdwatcher/source_multitable.go @@ -290,7 +290,7 @@ func (self *MultiTableBirdwatcher) Neighbours() (*api.NeighboursResponse, error) // Sum up all routes from all peers for a table for _, protocol := range tree[table].(map[string]interface{}) { // Skip peers that are not up (start/down) - if protocol.(map[string]interface{})["state"].(string) != "up" { + if !isProtocolUp(protocol.(map[string]interface{})["state"].(string)) { continue } allRoutesImported += int64(protocol.(map[string]interface{})["routes"].(map[string]interface{})["imported"].(float64)) @@ -331,7 +331,7 @@ func (self *MultiTableBirdwatcher) Neighbours() (*api.NeighboursResponse, error) // to query birdwatcher again. for _, protocol := range tree[table].(map[string]interface{}) { // Skip peers that are not up (start/down) - if protocol.(map[string]interface{})["state"].(string) != "up" { + if !isProtocolUp(protocol.(map[string]interface{})["state"].(string)) { continue } filtered[protocol.(map[string]interface{})["protocol"].(string)] = int(protocol.(map[string]interface{})["routes"].(map[string]interface{})["imported"].(float64))