mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
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 <[email protected]>
This commit is contained in:
+11
-4
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user