diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-05-17 04:20:35 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-21 07:45:13 +0900 |
commit | 42ab0376359f1ee378958b7ae37eaf8fbc7a811b (patch) | |
tree | 7ac468e9f0daf3c5c628ad4df88b95861698dcbb | |
parent | c7e1f88da3b73fbf6dc641581b6249830071a50e (diff) |
policy: apply export-policy after normal path-attribute updates
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | server/peer.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/peer.go b/server/peer.go index e8890bc2..a1738e63 100644 --- a/server/peer.go +++ b/server/peer.go @@ -188,14 +188,19 @@ func (peer *Peer) processOutgoingPaths(paths, withdrawals []*table.Path) []*tabl Neighbor: peer.fsm.peerInfo.Address, } for _, path := range paths { - path = peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, filterpath(peer, path), options) - if path == nil { + if filterpath(peer, path) == nil { continue } if !peer.isRouteServerClient() { path = path.Clone(path.IsWithdraw) path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf) } + + path = peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, path, options) + if path == nil { + continue + } + outgoing = append(outgoing, path) } |