diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-01-23 17:00:44 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-02-08 15:33:34 +0900 |
commit | 1fd46103728f0ed421a74a5fd6b96cb74b44bb38 (patch) | |
tree | d57428c3e439cfa63c6f6b60153b40c0913e29d5 /table/destination.go | |
parent | 5322e63522e9320bc460f5a68538d24d11c5a0ef (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 'table/destination.go')
-rw-r--r-- | table/destination.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/table/destination.go b/table/destination.go index 15029d52..c1da67cf 100644 --- a/table/destination.go +++ b/table/destination.go @@ -36,6 +36,7 @@ type BestPathReason uint8 const ( BPR_UNKNOWN BestPathReason = iota + BPR_DISABLED BPR_ONLY_PATH BPR_REACHABLE_NEXT_HOP BPR_HIGHEST_WEIGHT @@ -53,6 +54,7 @@ const ( var BestPathReasonStringMap = map[BestPathReason]string{ BPR_UNKNOWN: "Unknown", + BPR_DISABLED: "Bestpath selection disabled", BPR_ONLY_PATH: "Only Path", BPR_REACHABLE_NEXT_HOP: "Reachable Next Hop", BPR_HIGHEST_WEIGHT: "Highest Weight", @@ -515,6 +517,12 @@ func (dest *Destination) implicitWithdraw() paths { } func (dest *Destination) computeKnownBestPath() (*Path, BestPathReason, error) { + if SelectionOptions.DisableBestPathSelection { + log.WithFields(log.Fields{ + "Topic": "Table", + }).Debug("computeKnownBestPath skipped") + return nil, BPR_DISABLED, nil + } // If we do not have any paths to this destination, then we do not have // new best path. |