summaryrefslogtreecommitdiffhomepage
path: root/server
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 /server
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 'server')
-rw-r--r--server/server.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go
index 48986f72..5c6b3ab6 100644
--- a/server/server.go
+++ b/server/server.go
@@ -484,6 +484,10 @@ func clonePathList(pathList []*table.Path) []*table.Path {
}
func (server *BgpServer) notifyBestWatcher(best []*table.Path, multipath [][]*table.Path) {
+ if table.SelectionOptions.DisableBestPathSelection {
+ // Note: If best path selection disabled, no best path to notify.
+ return
+ }
clonedM := make([][]*table.Path, len(multipath))
for i, pathList := range multipath {
clonedM[i] = clonePathList(pathList)
@@ -555,6 +559,10 @@ func (server *BgpServer) notifyPostPolicyUpdateWatcher(peer *Peer, pathList []*t
}
func dstsToPaths(id string, dsts []*table.Destination, addpath bool) ([]*table.Path, []*table.Path, [][]*table.Path) {
+ if table.SelectionOptions.DisableBestPathSelection {
+ // Note: If best path selection disabled, there is no best path.
+ return nil, nil, nil
+ }
bestList := make([]*table.Path, 0, len(dsts))
oldList := make([]*table.Path, 0, len(dsts))
mpathList := make([][]*table.Path, 0, len(dsts))
@@ -790,6 +798,10 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) {
}
func (server *BgpServer) propagateUpdateToNeighbors(peer *Peer, dsts []*table.Destination, gBestList, gOldList []*table.Path) {
+ if table.SelectionOptions.DisableBestPathSelection {
+ // Note: If best path selection disabled, no best path to propagate.
+ return
+ }
families := make(map[bgp.RouteFamily][]*table.Destination)
for _, dst := range dsts {
family := dst.Family()