summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorFaicker Mo <faicker.mo@ucloud.cn>2019-11-08 09:34:00 +0800
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-03-03 09:47:50 +0900
commitcd5671baee534da4a4e4d70f7597919b315b04bf (patch)
tree484efa1d6ad127349eaee3856d12e0ccc9ed13a4 /cmd
parent2d73cf8eba6a8c978442dccc2d4c1ad9538ca1a9 (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 'cmd')
-rw-r--r--cmd/gobgp/policy.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/gobgp/policy.go b/cmd/gobgp/policy.go
index f90b68b0..1e87a6a9 100644
--- a/cmd/gobgp/policy.go
+++ b/cmd/gobgp/policy.go
@@ -99,6 +99,9 @@ func prettyString(v interface{}) string {
if a.Self {
return "self"
}
+ if a.Unchanged {
+ return "unchanged"
+ }
return a.Address
case *api.AsPrependAction:
return fmt.Sprintf("prepend %d %d times", a.Asn, a.Repeat)
@@ -940,7 +943,7 @@ func modAction(name, op string, args []string) error {
case "next-hop":
stmt.Actions.Nexthop = &api.NexthopAction{}
if len(args) != 1 {
- return fmt.Errorf("%s next-hop { <value> | self }", usage)
+ return fmt.Errorf("%s next-hop { <value> | self | unchanged }", usage)
}
stmt.Actions.Nexthop.Address = args[0]
}