summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 08:38:53 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 09:17:20 +0000
commite21e48410a6ff36db38973c59aca0b8f89083809 (patch)
tree838c57128614f8b3436cd758272be218782270ba /server/server.go
parentb7f47bc844be1e5969448c1cb4f485074610070f (diff)
server: fix bug of policy assignment
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/server.go b/server/server.go
index a182c26b..0a447783 100644
--- a/server/server.go
+++ b/server/server.go
@@ -2856,16 +2856,16 @@ func (server *BgpServer) handleGrpcModPolicyAssignment(grpcReq *GrpcRequest) err
}
case api.Operation_DEL:
n := make([]*table.Policy, 0, len(cur)-len(ps))
- for _, x := range ps {
+ for _, y := range cur {
found := false
- for _, y := range cur {
+ for _, x := range ps {
if x.Name() == y.Name() {
found = true
break
}
}
if !found {
- n = append(n, x)
+ n = append(n, y)
}
}
err = server.policy.SetPolicy(id, dir, n)