From 682e42c98d2abc9da97f1fb925533483fcf1a834 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 12 Sep 2019 22:17:18 +0900 Subject: table: improve table.Info for global rib Signed-off-by: FUJITA Tomonori --- internal/pkg/table/table.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'internal') 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{ -- cgit v1.2.3