From b77dc6aa54d0d2ebe4858ab688a10a44ef4cf773 Mon Sep 17 00:00:00 2001 From: Wataru Ishida Date: Sat, 12 Nov 2016 09:01:33 +0000 Subject: 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 --- api/grpc_server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'api') 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 { -- cgit v1.2.3