summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/server.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/server/server.go b/server/server.go
index 6deea0dd..ceaef726 100644
--- a/server/server.go
+++ b/server/server.go
@@ -491,10 +491,17 @@ func (s *BgpServer) filterpath(peer *Peer, path, old *table.Path) *table.Path {
dst := peer.localRib.GetDestination(path)
path = nil
for _, p := range dst.GetKnownPathList(peer.TableID(), peer.AS()) {
- // Just take care not to send back.
- if peer.ID() != p.GetSource().Address.String() {
- path = p
- break
+ srcPeer := p.GetSource()
+ if peer.ID() != srcPeer.Address.String() {
+ if srcPeer.RouteReflectorClient {
+ // The path from a RR client is preferred than others
+ // for the case that RR and non RR client peering
+ // (e.g., peering of different RR clusters).
+ path = p
+ break
+ } else if path == nil {
+ path = p
+ }
}
}
}