diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2017-04-18 06:29:42 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2017-04-18 07:40:15 +0000 |
commit | c8cb20e75bb830f1a9fe1037356a4007faaba04d (patch) | |
tree | 4ae0d650b1f6da4da0fb52c00f0301dce3d0fb6f /server/server.go | |
parent | 353c9c1711ac27ec38ac2fa179e02935e5c5e879 (diff) |
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 <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 4 |
1 files changed, 2 insertions, 2 deletions
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) } } |