From e55122db0becb2edcd592eed4abc95348d30d9d1 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 20 Apr 2016 08:50:03 +0000 Subject: policy: check duplicated policy name Signed-off-by: ISHIDA Wataru --- table/policy.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'table') 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] -- cgit v1.2.3