summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-05-25 11:33:21 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-05-27 21:04:43 +0900
commit497412e120d80844e55c79fbe47ce62fbec26edc (patch)
treee0cdfc6061454ae87aecee30d5d659a267cbdedb /server/peer.go
parent637b5f9ba663b739de54069d91b1d87ddd3b4855 (diff)
scenario_test: add policy test cases for new action and conditions
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/server/peer.go b/server/peer.go
index 46db99a9..63c907ee 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -695,20 +695,23 @@ func (peer *Peer) sendUpdateMsgFromPaths(pList []table.Path) {
}
if !path.IsWithdraw() {
- applied, path := peer.applyPolicies(peer.exportPolicies, path)
- if applied && path == nil {
- log.WithFields(log.Fields{
- "Topic": "Peer",
- "Key": peer.peerConfig.NeighborAddress,
- "Data": path,
- }).Debug("Export policy applied, reject.")
- continue
+ var applied bool = false
+ applied, path = peer.applyPolicies(peer.exportPolicies, path)
+ if applied {
+ if path == nil {
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": peer.peerConfig.NeighborAddress,
+ "Data": path,
+ }).Debug("Export policy applied and rejected.")
+ continue
+ }
} else if peer.defaultExportPolicy != config.DEFAULT_POLICY_TYPE_ACCEPT_ROUTE {
log.WithFields(log.Fields{
"Topic": "Peer",
"Key": peer.peerConfig.NeighborAddress,
"Data": path,
- }).Debug("Default export policy applied, reject.")
+ }).Debug("Default export policy applied and rejected.")
continue
}
}