This commit fixes a case where may-exist flag was not honored. When the nat type and logical ip both match for snat, but the external_ip is not the same, the may-exist flag was being ignored.
Signed-off-by: Aniket Bhat <anb...@redhat.com> --- utilities/ovn-nbctl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index e6d8dbe..8194414 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -4295,11 +4295,13 @@ nbctl_lr_nat_add(struct ctl_context *ctx) should_return = true; } } else { - ctl_error(ctx, "a NAT with this type (%s) and %s (%s) " - "already exists", - nat_type, - is_snat ? "logical_ip" : "external_ip", - is_snat ? new_logical_ip : new_external_ip); + if (!may_exist) { + ctl_error(ctx, "a NAT with this type (%s) and %s (%s) " + "already exists", + nat_type, + is_snat ? "logical_ip" : "external_ip", + is_snat ? new_logical_ip : new_external_ip); + } should_return = true; } } -- 2.9.5 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev