diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-09-12 22:17:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-09-12 22:17:18 +0900 |
commit | 682e42c98d2abc9da97f1fb925533483fcf1a834 (patch) | |
tree | d606be53c4428bbc2b0680826ea595944f0d0b39 /internal/pkg/table/table.go | |
parent | 03f8fb262c7a9389226404e92c6b0bb7ad1a099e (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.go | 13 |
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{ |