diff mbox series

[ovs-dev,v2,4/7] binding: Cleanup related_lports for container ports.

Message ID 20240723155444.2530187-5-xsimonar@redhat.com
State Accepted
Delegated to: Numan Siddique
Headers show
Series pmtud and related ports. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Xavier Simonart July 23, 2024, 3:54 p.m. UTC
Remove container port from related_lports if parent port is deleted.

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 controller/binding.c | 4 +++-
 tests/ovn.at         | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/controller/binding.c b/controller/binding.c
index 1bb5cca52..210809944 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -1533,8 +1533,10 @@  release_binding_lport(const struct sbrec_chassis *chassis_rec,
                       struct binding_lport *b_lport, bool sb_readonly,
                       struct binding_ctx_out *b_ctx_out)
 {
-    if (is_binding_lport_this_chassis(b_lport, chassis_rec)) {
+    if (b_lport && b_lport->pb) {
         remove_related_lport(b_lport->pb, b_ctx_out);
+    }
+    if (is_binding_lport_this_chassis(b_lport, chassis_rec)) {
         if (!release_lport(b_lport->pb, chassis_rec, sb_readonly,
                            b_ctx_out->tracked_dp_bindings,
                            b_ctx_out->if_mgr)) {
diff --git a/tests/ovn.at b/tests/ovn.at
index 482544ac2..bd66f602c 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -16487,8 +16487,8 @@  AT_CHECK([test "${hv1_claims}" -le "${max_claims}"], [0], [])
 AT_CHECK([test "${hv2_claims}" -le "${max_claims}"], [0], [])
 
 check ovn-nbctl --wait=hv lsp-del lsp0
-CHECK_FLOWS_AFTER_RECOMPUTE([hv1], [hv1])
-CHECK_FLOWS_AFTER_RECOMPUTE([hv2], [hv2])
+
+CHECK_AFTER_RECOMPUTE([hv1], [hv1])
 
 OVN_CLEANUP([hv1],[hv2])