summaryrefslogtreecommitdiffhomepage
path: root/table/policy.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 08:50:03 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 09:17:22 +0000
commite55122db0becb2edcd592eed4abc95348d30d9d1 (patch)
tree2df2cfa957898f0ce7b89be182759f501b3327b5 /table/policy.go
parent733b05b83185d3c1dd0c783462d91a10400c0ae2 (diff)
policy: check duplicated policy name
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/policy.go')
-rw-r--r--table/policy.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/table/policy.go b/table/policy.go
index 66416931..acec2980 100644
--- a/table/policy.go
+++ b/table/policy.go
@@ -2804,6 +2804,9 @@ func (r *RoutingPolicy) Reload(c config.RoutingPolicy) error {
if err != nil {
return err
}
+ if _, ok := pmap[y.Name()]; ok {
+ return fmt.Errorf("duplicated policy name. policy name must be unique.")
+ }
pmap[y.Name()] = y
for _, s := range y.Statements {
_, ok := smap[s.Name]