summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-21 14:56:55 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-23 09:46:53 +0900
commitb09e276561c9b36010527a25d995b962611bc655 (patch)
treea4ce414a7f6daa0ad2577376749c8b2cc1957e8e /server
parentc5fae01b021924295f38ad4ab3a34e9f960d0200 (diff)
policy: apply export-policy after normal path-attribute updates
fix incomplete 42ab0376359f1ee378958b7ae37eaf8fbc7a811b Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/peer.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/peer.go b/server/peer.go
index ec7fb22a..c985d771 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -137,15 +137,20 @@ func (peer *Peer) getBestFromLocal(rfList []bgp.RouteFamily) ([]*table.Path, []*
Neighbor: peer.fsm.peerInfo.Address,
}
for _, path := range peer.localRib.GetBestPathList(peer.TableID(), rfList) {
- p := peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, filterpath(peer, path), options)
- if p == nil {
- filtered = append(filtered, path)
+ if filterpath(peer, path) == nil {
continue
}
+ p := path
if !peer.isRouteServerClient() {
- p = p.Clone(p.IsWithdraw)
+ p = path.Clone(p.IsWithdraw)
p.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf)
}
+ p = peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, p, options)
+ if p == nil {
+ filtered = append(filtered, path)
+ continue
+ }
+
pathList = append(pathList, p)
}
if peer.isGracefulRestartEnabled() {