summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-08-11 16:12:12 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-08-11 16:12:12 +0900
commit3a3086c1f4ad70cd1190c44158b1bd47b0509976 (patch)
treed942d7b7508b9b9c723b12078c5bed9124d7efd9
parentd0a23b253cc485a16066927bf92704bb287972cf (diff)
server: fix handling the best path change from ebgp to ibgp
We have the best path from ebgp and advertise it to an ibgp peer. Then we got the new best from ibgp and then we have to explicitly withdraw the old best (and don't send the new best from ibgp to the ibgp peer). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/server.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go
index 6fa8fe4b..ae036a83 100644
--- a/server/server.go
+++ b/server/server.go
@@ -339,6 +339,17 @@ func filterpath(peer *Peer, path *table.Path, withdrawals []*table.Path) *table.
}
if ignore {
+
+ for _, adv := range peer.adjRibOut.PathList([]bgp.RouteFamily{path.GetRouteFamily()}, false) {
+ // we advertise a route from ebgp,
+ // which is the old best. We got the
+ // new best from ibgp. We don't
+ // advertise the new best and need to
+ // withdraw the old.
+ if path.GetNlri().String() == adv.GetNlri().String() {
+ return adv.Clone(true)
+ }
+ }
log.WithFields(log.Fields{
"Topic": "Peer",
"Key": peer.ID(),