diff options
author | Faicker Mo <faicker.mo@ucloud.cn> | 2019-11-08 09:34:00 +0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-03-03 09:47:50 +0900 |
commit | cd5671baee534da4a4e4d70f7597919b315b04bf (patch) | |
tree | 484efa1d6ad127349eaee3856d12e0ccc9ed13a4 /pkg/server | |
parent | 2d73cf8eba6a8c978442dccc2d4c1ad9538ca1a9 (diff) |
policy: add nexthop unchanged
Support config set-next-hop = "unchanged" and also cli command.
Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/grpc_server.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go index a057d6ae..89bbb497 100644 --- a/pkg/server/grpc_server.go +++ b/pkg/server/grpc_server.go @@ -1167,6 +1167,11 @@ func toStatementApi(s *config.Statement) *api.Statement { Self: true, } } + if string(s.Actions.BgpActions.SetNextHop) == "unchanged" { + return &api.NexthopAction{ + Unchanged: true, + } + } return &api.NexthopAction{ Address: string(s.Actions.BgpActions.SetNextHop), } @@ -1442,6 +1447,9 @@ func newNexthopActionFromApiStruct(a *api.NexthopAction) (*table.NexthopAction, if a.Self { return "self" } + if a.Unchanged { + return "unchanged" + } return a.Address }(), )) |