mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
pkg/server: handleUpdate() should not inject echo route from RR
This commit is contained in:
@@ -491,6 +491,24 @@ func (peer *Peer) handleUpdate(e *FsmMsg) ([]*table.Path, []bgp.RouteFamily, *bg
|
||||
continue
|
||||
}
|
||||
}
|
||||
// RFC4456 8. Avoiding Routing Information Loops
|
||||
// A router that recognizes the ORIGINATOR_ID attribute SHOULD
|
||||
// ignore a route received with its BGP Identifier as the ORIGINATOR_ID.
|
||||
peer.fsm.lock.RLock()
|
||||
isIBGPPeer := peer.isIBGPPeer()
|
||||
routerId := peer.fsm.gConf.Config.RouterId
|
||||
peer.fsm.lock.RUnlock()
|
||||
if isIBGPPeer {
|
||||
if id := path.GetOriginatorID(); routerId == id.String() {
|
||||
log.WithFields(log.Fields{
|
||||
"Topic": "Peer",
|
||||
"Key": peer.ID(),
|
||||
"OriginatorID": id,
|
||||
"Data": path,
|
||||
}).Debug("Originator ID is mine, ignore")
|
||||
continue
|
||||
}
|
||||
}
|
||||
paths = append(paths, path)
|
||||
}
|
||||
peer.adjRibIn.Update(e.PathList)
|
||||
|
||||
@@ -423,21 +423,6 @@ func filterpath(peer *Peer, path, old *table.Path) *table.Path {
|
||||
if info.AS != peer.AS() {
|
||||
ignore = false
|
||||
}
|
||||
// RFC4456 8. Avoiding Routing Information Loops
|
||||
// A router that recognizes the ORIGINATOR_ID attribute SHOULD
|
||||
// ignore a route received with its BGP Identifier as the ORIGINATOR_ID.
|
||||
peer.fsm.lock.RLock()
|
||||
routerId := peer.fsm.gConf.Config.RouterId
|
||||
peer.fsm.lock.RUnlock()
|
||||
if id := path.GetOriginatorID(); routerId == id.String() {
|
||||
log.WithFields(log.Fields{
|
||||
"Topic": "Peer",
|
||||
"Key": peer.ID(),
|
||||
"OriginatorID": id,
|
||||
"Data": path,
|
||||
}).Debug("Originator ID is mine, ignore")
|
||||
return nil
|
||||
}
|
||||
if info.RouteReflectorClient {
|
||||
ignore = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user