summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/table/table.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2019-09-12 22:17:18 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-09-12 22:17:18 +0900
commit682e42c98d2abc9da97f1fb925533483fcf1a834 (patch)
treed606be53c4428bbc2b0680826ea595944f0d0b39 /internal/pkg/table/table.go
parent03f8fb262c7a9389226404e92c6b0bb7ad1a099e (diff)
table: improve table.Info for global rib
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'internal/pkg/table/table.go')
-rw-r--r--internal/pkg/table/table.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/pkg/table/table.go b/internal/pkg/table/table.go
index 9a9bdd8b..f6ed2444 100644
--- a/internal/pkg/table/table.go
+++ b/internal/pkg/table/table.go
@@ -438,10 +438,15 @@ type TableInfo struct {
func (t *Table) Info(id string, as uint32) *TableInfo {
var numD, numP int
for _, d := range t.destinations {
- ps := d.GetKnownPathList(id, as)
- if len(ps) > 0 {
- numD += 1
- numP += len(ps)
+ n := 0
+ if id == GLOBAL_RIB_NAME {
+ n = len(d.knownPathList)
+ } else {
+ n = len(d.GetKnownPathList(id, as))
+ }
+ if n != 0 {
+ numD++
+ numP += n
}
}
return &TableInfo{