summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2017-04-18 06:29:42 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2017-04-18 07:40:15 +0000
commitc8cb20e75bb830f1a9fe1037356a4007faaba04d (patch)
tree4ae0d650b1f6da4da0fb52c00f0301dce3d0fb6f /server/peer.go
parent353c9c1711ac27ec38ac2fa179e02935e5c5e879 (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/peer.go')
-rw-r--r--server/peer.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index 15029bd6..ed4d1ae4 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -278,6 +278,14 @@ func (peer *Peer) filterpath(path, old *table.Path) *table.Path {
Info: peer.fsm.peerInfo,
}
path = peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, path, options)
+ // When 'path' is filetered (path == nil), check 'old' has been sent to this peer.
+ // If it has, send withdrawal to the peer.
+ if path == nil && old != nil {
+ o := peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, old, options)
+ if o != nil {
+ path = old.Clone(true)
+ }
+ }
// draft-uttaro-idr-bgp-persistence-02
// 4.3. Processing LLGR_STALE Routes