From e117ae78ce8761b77b3d234b18464d0b0e1e35fe Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 27 Jul 2017 12:42:33 +0900 Subject: 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 --- table/destination.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'table/destination.go') 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", -- cgit v1.2.3