diff options
Diffstat (limited to 'policy')
-rw-r--r-- | policy/policy.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/policy/policy.go b/policy/policy.go index 11996a4b..9ad7b349 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -1335,9 +1335,11 @@ func ActionsToApiStruct(conActions config.Actions) *api.Actions { Communities: conActions.BgpActions.SetCommunity.Communities, Options: conActions.BgpActions.SetCommunity.Options, } + medAction := fmt.Sprintf("%s", conActions.BgpActions.SetMed) resActions := &api.Actions{ RouteAction: action, Community: communityAction, + Med: medAction, } return resActions } @@ -1348,6 +1350,10 @@ func ActionsToConfigStruct(reqActions *api.Actions) config.Actions { actions.BgpActions.SetCommunity.Communities = reqActions.Community.Communities actions.BgpActions.SetCommunity.Options = reqActions.Community.Options } + if reqActions.Med != "" { + actions.BgpActions.SetMed = config.BgpSetMedType(reqActions.Med) + } + switch reqActions.RouteAction { case ROUTE_ACCEPT: actions.AcceptRoute = true |