1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

bird2 compatible check with protocol state

This commit is contained in:
Matthias Hannig
2019-09-09 15:59:54 +02:00
parent d02ed4c049
commit e55c4a7d30

View File

@ -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))