summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorDumitru Ceara <dceara@redhat.com>2019-06-11 16:55:34 +0200
committerBen Pfaff <blp@ovn.org>2019-06-11 15:27:41 -0700
commitb76aa872e63cfdce312ab2d19d017e35c4ab10e9 (patch)
tree07c982e452a83bbc68b5ab302385d0945551dbae /ovn
parent4f746d526df255b11babe93005948a028b49ef90 (diff)
downloadopenvswitch-b76aa872e63cfdce312ab2d19d017e35c4ab10e9.tar.gz
ovn-controller: Cleanup memory in binding_evaluate_port_binding_changes
The 'lport_to_iface' and 'egress_ifaces' hashtables were not cleaned up when checking if port bindings require a recompute. Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2019-June/048822.html Reported-by: Daniel Alvarez Sanchez <dalvarez@redhat.com> Fixes: 9d0b504abdee ("ovn-controller: runtime_data change handler for SB port-binding") Acked-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/controller/binding.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
index b62b3da23..87d0b6d88 100644
--- a/ovn/controller/binding.c
+++ b/ovn/controller/binding.c
@@ -695,6 +695,8 @@ binding_evaluate_port_binding_changes(
return true;
}
+ bool changed = false;
+
const struct sbrec_port_binding *binding_rec;
struct shash lport_to_iface = SHASH_INITIALIZER(&lport_to_iface);
struct sset egress_ifaces = SSET_INITIALIZER(&egress_ifaces);
@@ -718,10 +720,14 @@ binding_evaluate_port_binding_changes(
|| is_our_chassis(chassis_rec, binding_rec,
active_tunnels, &lport_to_iface, local_lports)
|| strcmp(binding_rec->type, "")) {
- return true;
+ changed = true;
+ break;
}
}
- return false;
+
+ shash_destroy(&lport_to_iface);
+ sset_destroy(&egress_ifaces);
+ return changed;
}
/* Returns true if the database is all cleaned up, false if more work is