From c8cb20e75bb830f1a9fe1037356a4007faaba04d Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 18 Apr 2017 06:29:42 +0000 Subject: policy: send a withdrawal if export policy blocks an existing route This patch fixes a bug of export policy and implicit withdrawal. When a path is filtered by export policy, we need to check whether the old path (implicit withdrawn path) was sent before the new path. If it has been sent, we need to send a withdrawal message. Signed-off-by: ISHIDA Wataru --- server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 5238c33b..da6feba2 100644 --- a/server/server.go +++ b/server/server.go @@ -367,7 +367,7 @@ func filterpath(peer *Peer, path, old *table.Path) *table.Path { } if ignore { - if path.IsWithdraw == false && old != nil { + if !path.IsWithdraw && old != nil && old.GetSource().Address.String() != peer.ID() { // we advertise a route from ebgp, // which is the old best. We got the // new best from ibgp. We don't @@ -400,7 +400,7 @@ func filterpath(peer *Peer, path, old *table.Path) *table.Path { // the withdrawal path. // Thing is same when peer A and we advertized prefix P (as local // route), then, we withdraws the prefix. - if path.IsWithdraw == false && old != nil { + if !path.IsWithdraw && old != nil && old.GetSource().Address.String() != peer.ID() { return old.Clone(true) } } -- cgit v1.2.3