Blob Blame History Raw
From dff5ff1175d2c1f2a2619276aa287ecdeac04702 Mon Sep 17 00:00:00 2001
From: Ilya Maximets <i.maximets@ovn.org>
Date: Fri, 20 Nov 2020 01:17:22 +0100
Subject: [PATCH 14/16] ovn-nbctl: Fix IP leak on router NAT addition failure.

Cleanup needed instead of direct return.

Fixes: 43f42ecb3a5a ("Use normalized IP addreses in `ovn-nbctl lr-nat-add`")
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Numan Siddique <numans@ovn.org>

(cherry-picked from master commit 360b5bf20f23eb103edf86f3b13ab0a5fe0490db)
---
 utilities/ovn-nbctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 6f5117876..af9b396c3 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -4311,7 +4311,7 @@ nbctl_lr_nat_add(struct ctl_context *ctx)
 
     if (strcmp(nat_type, "dnat_and_snat") && stateless) {
         ctl_error(ctx, "stateless is not applicable to dnat or snat types");
-        return;
+        goto cleanup;
     }
 
     int is_snat = !strcmp("snat", nat_type);
-- 
2.28.0