summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/table_manager.go')
-rw-r--r--table/table_manager.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/table/table_manager.go b/table/table_manager.go
index b94b546e..498aabad 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -22,8 +22,9 @@ import (
"time"
farm "github.com/dgryski/go-farm"
- "github.com/osrg/gobgp/packet/bgp"
log "github.com/sirupsen/logrus"
+
+ "github.com/osrg/gobgp/packet/bgp"
)
const (
@@ -306,6 +307,10 @@ func (manager *TableManager) getDestinationCount(rfList []bgp.RouteFamily) int {
}
func (manager *TableManager) GetBestPathList(id string, rfList []bgp.RouteFamily) []*Path {
+ if SelectionOptions.DisableBestPathSelection {
+ // Note: If best path selection disabled, there is no best path.
+ return nil
+ }
paths := make([]*Path, 0, manager.getDestinationCount(rfList))
for _, t := range manager.tables(rfList...) {
paths = append(paths, t.Bests(id)...)
@@ -314,7 +319,9 @@ func (manager *TableManager) GetBestPathList(id string, rfList []bgp.RouteFamily
}
func (manager *TableManager) GetBestMultiPathList(id string, rfList []bgp.RouteFamily) [][]*Path {
- if !UseMultiplePaths.Enabled {
+ if !UseMultiplePaths.Enabled || SelectionOptions.DisableBestPathSelection {
+ // Note: If multi path not enabled or best path selection disabled,
+ // there is no best multi path.
return nil
}
paths := make([][]*Path, 0, manager.getDestinationCount(rfList))