From 497412e120d80844e55c79fbe47ce62fbec26edc Mon Sep 17 00:00:00 2001 From: Hiroshi Yokoi Date: Mon, 25 May 2015 11:33:21 +0900 Subject: scenario_test: add policy test cases for new action and conditions --- server/peer.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'server/peer.go') 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 } } -- cgit v1.2.3