summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-27 12:42:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-27 12:42:33 +0900
commite117ae78ce8761b77b3d234b18464d0b0e1e35fe (patch)
tree89c7739eeedda1502d2c506fb69016fe7106224c
parente7b9739c9f8600ac57c1ddb56cbdf3c62b4c1692 (diff)
table: disable wrong warning about aspath
With addpath support, two paths from API without AS_PATH attribute could be compared. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--table/destination.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/table/destination.go b/table/destination.go
index 9057d4f4..15d80e1d 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -736,7 +736,9 @@ func compareByASPath(path1, path2 *Path) *Path {
attribute1 := path1.getPathAttr(bgp.BGP_ATTR_TYPE_AS_PATH)
attribute2 := path2.getPathAttr(bgp.BGP_ATTR_TYPE_AS_PATH)
- if attribute1 == nil || attribute2 == nil {
+ // With addpath support, we could compare paths from API don't
+ // AS_PATH. No need to warn here.
+ if !path1.IsLocal() && !path2.IsLocal() && (attribute1 == nil || attribute2 == nil) {
log.WithFields(log.Fields{
"Topic": "Table",
"Key": "compareByASPath",