diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-12 09:01:33 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-14 00:58:25 +0000 |
commit | b77dc6aa54d0d2ebe4858ab688a10a44ef4cf773 (patch) | |
tree | b17eabc69fee61dde9d26dca39060970f4033c9c /api | |
parent | b68491f62cff983d360753130aa4ff77ae753602 (diff) |
policy: fix bug of policy with multiple statements
policy can have multiple statements. In each statement, when condition
is matched, route-action is finally evaluated after actions with mods.
When route-action is 'none', we contine to next statement if it exists.
When route-action is 'accept' or 'reject', we stop proceeding.
This patch fixes a bug that route-action can't be set to 'none' which
means route-action always be set to 'accept' or 'reject' and can't proceed
to the next statement.
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api')
-rw-r--r-- | api/grpc_server.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index 34139d4e..af16dccf 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -1068,7 +1068,10 @@ func toStatementApi(s *config.Statement) *Statement { if s.Actions.RouteDisposition.AcceptRoute { return RouteAction_ACCEPT } - return RouteAction_REJECT + if s.Actions.RouteDisposition.RejectRoute { + return RouteAction_REJECT + } + return RouteAction_NONE }(), Community: func() *CommunityAction { if len(s.Actions.BgpActions.SetCommunity.SetCommunityMethod.CommunitiesList) == 0 { |