From ee6957f08d3a666503a068ba479ddb9e03d568b7 Mon Sep 17 00:00:00 2001 From: Kunihiro Ishiguro Date: Tue, 11 Feb 2020 12:38:51 -0800 Subject: [PATCH 1/2] local CLUSTER_ID check in CLUSTER_LIST should be performed to non route reflector client also. --- pkg/server/server.go | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index d9e149266..f60558cd8 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -505,26 +505,24 @@ func filterpath(peer *peer, path, old *table.Path) *table.Path { if info.RouteReflectorClient { ignore = false } - if peer.isRouteReflectorClient() { - // RFC4456 8. Avoiding Routing Information Loops - // If the local CLUSTER_ID is found in the CLUSTER_LIST, - // the advertisement received SHOULD be ignored. - for _, clusterID := range path.GetClusterList() { - peer.fsm.lock.RLock() - rrClusterID := peer.fsm.peerInfo.RouteReflectorClusterID - peer.fsm.lock.RUnlock() - if clusterID.Equal(rrClusterID) { - log.WithFields(log.Fields{ - "Topic": "Peer", - "Key": peer.ID(), - "ClusterID": clusterID, - "Data": path, - }).Debug("cluster list path attribute has local cluster id, ignore") - return nil - } + // RFC4456 8. Avoiding Routing Information Loops + // If the local CLUSTER_ID is found in the CLUSTER_LIST, + // the advertisement received SHOULD be ignored. + for _, clusterID := range path.GetClusterList() { + peer.fsm.lock.RLock() + rrClusterID := peer.fsm.peerInfo.RouteReflectorClusterID + peer.fsm.lock.RUnlock() + if clusterID.Equal(rrClusterID) { + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": peer.ID(), + "ClusterID": clusterID, + "Data": path, + }).Debug("cluster list path attribute has local cluster id, ignore") + return nil } - ignore = false } + ignore = false } if ignore { From 0f74c46b88f32407cba2351b57f919b398dd3bab Mon Sep 17 00:00:00 2001 From: Kunihiro Ishiguro Date: Wed, 12 Feb 2020 07:42:38 -0800 Subject: [PATCH 2/2] Keep current logic for setting ignore. --- pkg/server/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index f60558cd8..07e08a850 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -505,6 +505,9 @@ func filterpath(peer *peer, path, old *table.Path) *table.Path { if info.RouteReflectorClient { ignore = false } + if peer.isRouteReflectorClient() { + ignore = false + } // RFC4456 8. Avoiding Routing Information Loops // If the local CLUSTER_ID is found in the CLUSTER_LIST, // the advertisement received SHOULD be ignored. @@ -522,7 +525,6 @@ func filterpath(peer *peer, path, old *table.Path) *table.Path { return nil } } - ignore = false } if ignore {