gobgp icon indicating copy to clipboard operation
gobgp copied to clipboard

GoBGP doesn't report number of destinations in ADJ-IN correctly

Open atashbahar opened this issue 1 year ago • 1 comments

When calling GetTable to get number of destinations and paths, both values are the same. This is due to the fact that both are populated with the same value [ref]:

func (adj *AdjRib) TableInfo(family bgp.RouteFamily) (*TableInfo, error) {
	if _, ok := adj.table[family]; !ok {
		return nil, fmt.Errorf("%s unsupported", family)
	}
	c := adj.Count([]bgp.RouteFamily{family})
	a := adj.Accepted([]bgp.RouteFamily{family})
	return &TableInfo{
		NumDestination: c,
		NumPath:        c,
		NumAccepted:    a,
	}, nil
}

Is this expected behavior or a bug?

atashbahar avatar Jun 21 '24 01:06 atashbahar

Seems logical to me, since one peer cannot produce more than one path per destination. In GRT, though, since it is combined view of all peers it's not true - there are more paths than destinations.

myaut avatar Jan 15 '25 07:01 myaut