diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-04-19 16:08:33 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-05-28 09:24:16 +0900 |
commit | fead8a63e41d4e7626b6c648d3b8de4968ad515b (patch) | |
tree | dd901d396527e05c52c1dffba167dbfd6d5eb88d /server/server.go | |
parent | 36d682afc2a16a29708aacfb0687d010a3b69348 (diff) |
server: Prefer RTC route from RR client
In case that a Route Reflector(RR) and a non RR client peering, peering
of different RR clusters for example, the RR should send the RTC route
from its client even if the RTC route from non RR client is better path
based on the best path algorithm in order to notify that some RR clients
are interested in the given Route Target.
Currently, only source peer address is concerned, the RTC route from RR
client can have lower priority than non RR client and it can not be
advertised.
This patch fixes to prefer the route from RR client when selecting the
candidate to be advertised.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 15 |
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 + } } } } |