summaryrefslogtreecommitdiffhomepage
path: root/api
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-23 17:00:44 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2018-02-08 15:33:34 +0900
commit1fd46103728f0ed421a74a5fd6b96cb74b44bb38 (patch)
treed57428c3e439cfa63c6f6b60153b40c0913e29d5 /api
parent5322e63522e9320bc460f5a68538d24d11c5a0ef (diff)
config: Option to disable best path selection
Note: When this option is specified, no path will be redistributed to any peer, because there is no best path. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'api')
-rw-r--r--api/grpc_server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go
index 67ff7722..817199b5 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -462,7 +462,7 @@ func (s *Server) GetRib(ctx context.Context, arg *GetRibRequest) (*GetRibRespons
pp := ToPathApi(p)
switch arg.Table.Type {
case Resource_LOCAL, Resource_GLOBAL:
- if i == 0 {
+ if i == 0 && !table.SelectionOptions.DisableBestPathSelection {
pp.Best = true
}
}
@@ -517,7 +517,7 @@ func (s *Server) GetPath(arg *GetPathRequest, stream GobgpApi_GetPathServer) err
for _, dst := range tbl.GetDestinations() {
for idx, path := range dst.GetAllKnownPathList() {
p := ToPathApi(path)
- if idx == 0 {
+ if idx == 0 && !table.SelectionOptions.DisableBestPathSelection {
switch arg.Type {
case Resource_LOCAL, Resource_GLOBAL:
p.Best = true