diff mbox series

[ovs-dev,ovn] ovn-nbctl: Add some hint for --ecmp in error message.

Message ID 1592616319-10646-1-git-send-email-hzhou@ovn.org
State New
Headers show
Series [ovs-dev,ovn] ovn-nbctl: Add some hint for --ecmp in error message. | expand

Commit Message

Han Zhou June 20, 2020, 1:25 a.m. UTC
Add the hint to remind user about --ecmp option when needed.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 tests/ovn-nbctl.at    | 2 +-
 utilities/ovn-nbctl.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 14de1a8..54b4ad2 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -1414,7 +1414,7 @@  AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.1/24 11.0.0.2])
 
 dnl Add overlapping route with 10.0.0.1/24
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111/24 11.0.0.1], [1], [],
-  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip)
+  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip). Use option --ecmp to allow this for ECMP routing.
 ])
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111a/24 11.0.0.1], [1], [],
   [ovn-nbctl: bad prefix argument: 10.0.0.111a/24
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 6ccc702..75fd8f9 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3833,7 +3833,8 @@  nbctl_lr_route_add(struct ctl_context *ctx)
             }
 
             if (!may_exist) {
-                ctl_error(ctx, "duplicate prefix: %s (policy: %s)",
+                ctl_error(ctx, "duplicate prefix: %s (policy: %s). Use option"
+                          " --ecmp to allow this for ECMP routing.",
                           prefix, is_src_route ? "src-ip" : "dst-ip");
                 free(next_hop);
                 free(rt_prefix);