]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ovn-nbctl: Ability to update a route's output port.
authorGurucharan Shetty <guru@ovn.org>
Fri, 1 Jul 2016 05:53:50 +0000 (22:53 -0700)
committerGurucharan Shetty <guru@ovn.org>
Fri, 1 Jul 2016 23:03:55 +0000 (16:03 -0700)
The command 'lr-route-add' currently cannot update the output
port.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
ovn/utilities/ovn-nbctl.c
tests/ovn-nbctl.at

index 345647ac2f80f2a933d3c57b26b85dc2c8e94a8e..abeba0b8bbb12ffb00b848db6a18c103d5910edc 100644 (file)
@@ -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);
index d2d74b68197ea0a44d8d4645db82705f0805161d..0c756ed41a937b68690273e697366ed7da7f16a7 100644 (file)
@@ -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
 ])