diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-06-24 21:32:11 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-07-01 14:26:31 +0900 |
commit | d45e2c9dfafb78001dd3b17fe42c1eb822bff3e9 (patch) | |
tree | b1c5315fe35da5e89d876ab0d82900d3b4ab3cc2 /server | |
parent | 8339ada8dfffd086a4fadc10e729bbe07d3e3e83 (diff) |
scenario_test: add test cases for distribute policy
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go index 08831efa..fb957cac 100644 --- a/server/server.go +++ b/server/server.go @@ -276,7 +276,6 @@ func (server *BgpServer) Serve() { senderMsgs = append(senderMsgs, m...) } case pl := <-server.policyUpdateCh: - log.Info("handle policy update ") server.handlePolicy(pl) } } @@ -383,6 +382,8 @@ func (server *BgpServer) dropPeerAllRoutes(peer *Peer) []*SenderMsg { func applyPolicies(peer *Peer, loc *LocalRib, d Direction, pathList []*table.Path) []*table.Path { var defaultPolicy config.DefaultPolicyType + ret := make([]*table.Path, 0, len(pathList)) + switch d { case POLICY_DIRECTION_EXPORT: defaultPolicy = loc.defaultExportPolicy @@ -395,9 +396,9 @@ func applyPolicies(peer *Peer, loc *LocalRib, d Direction, pathList []*table.Pat "Topic": "Server", "Key": peer.config.NeighborAddress, }).Error("direction is not specified.") + return ret } - ret := make([]*table.Path, 0, len(pathList)) for _, path := range pathList { if !path.IsWithdraw { var applied bool = false |