The command 'lr-route-add' currently cannot update the output
port.
Signed-off-by: Gurucharan Shetty <[email protected]>
---
ovn/utilities/ovn-nbctl.c | 4 ++++
tests/ovn-nbctl.at | 10 +++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 345647a..abeba0b 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1383,6 +1383,10 @@ nbctl_lr_route_add(struct ctl_context *ctx)
nbrec_logical_router_static_route_verify_nexthop(route);
nbrec_logical_router_static_route_set_ip_prefix(route, prefix);
nbrec_logical_router_static_route_set_nexthop(route, next_hop);
+ if (ctx->argc == 5) {
+ nbrec_logical_router_static_route_set_output_port(route,
+ ctx->argv[4]);
+ }
free(rt_prefix);
free(next_hop);
free(prefix);
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index d2d74b6..0c756ed 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -388,6 +388,14 @@ IPv4 Routes
0.0.0.0/0 192.168.0.1
])
+AT_CHECK([ovn-nbctl --may-exist lr-route-add lr0 10.0.0.111/24 11.0.0.1 lp1])
+AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl
+IPv4 Routes
+ 10.0.0.0/24 11.0.0.1 lp1
+ 10.0.1.0/24 11.0.1.1 lp0
+ 0.0.0.0/0 192.168.0.1
+])
+
dnl Delete non-existent prefix
AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.2.1/24], [1], [],
[ovn-nbctl: no matching prefix: 10.0.2.0/24
@@ -398,7 +406,7 @@ AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.1.1/24])
AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl
IPv4 Routes
- 10.0.0.0/24 11.0.0.1
+ 10.0.0.0/24 11.0.0.1 lp1
0.0.0.0/0 192.168.0.1
])
--
1.9.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev